even better

This commit is contained in:
reverend 2021-01-11 01:49:33 +01:00
parent 1a44e24805
commit 5a503eec70
2 changed files with 27 additions and 18 deletions

View File

@ -123,18 +123,17 @@ RV-Element(element_name)
stack_name = 'elements_to_generate'
if 'RV-Block__Modifier' in called-from
stack_name = 'block_modifier_elements_to_generate'
prefix = '.'
if block_name == '^[-2..-2]'
p('wurst')
prefix = ''
element_block = @block{
&__{element_name}{
for sub_block in _pop_stack(){
{sub_block}
}
for modifier_block in _pop_stack('element_modifiers_to_generate'){
{modifier_block}
&^[-3..-3]__{element_name}{
for modifier_block in _pop_stack('element_modifiers_to_generate'){
{modifier_block}
}
}
}
}
@ -161,7 +160,7 @@ RV-Element__Modifier(element_modifier_name)
if 'RV-Element' in called-from
//Infix, store for handling by element
modifier_block = @block{
& .{element_name}--{element_modifier_name}{
&--{element_modifier_name}{
for current_block in _pop_stack(){
{current_block}
}
@ -173,7 +172,7 @@ RV-Element__Modifier(element_modifier_name)
//Postfix, append to existing element
last_element_name = _get_last_name('RV-Element')
modifier_block = @block {
& .__{last_element_name}.__{last_element_name}--{element_modifier_name}{
& .{block_name}__{last_element_name}.{block_name}__{last_element_name}--{element_modifier_name}{
for current_block in _pop_stack(){
{current_block}
}

View File

@ -65,7 +65,10 @@ RV-Fan--fullWidth(base-height, base-width)
+RV-Element('Surface')
flex-grow 1
RV-Fan__Base--wurst()
--wurst 'wasser'
/* ###############
* Element Mixins
* ############### */
@ -76,12 +79,10 @@ RV-Fan__Base(base-height, base-width)
flex 0 0 auto
RV-Fan__Surface--fixedHeight(height)
+RV-Element__Modifier('fixedHeight')
height height
height height
RV-Fan__Surface--fixedWidth(width)
+RV-Element__Modifier('fixedWidth')
max-width width
max-width width
RV-Fan__Surface()
+RV-Element('Surface')
@ -99,13 +100,18 @@ RV-Fan()
.test
+RV-Block('Hasi')
--hasi 'lein'
RV-CSSParameter({
base-height: 280px,
base-width: 320px
})
RV-Fan()
+RV-Element('Flauschi')
--hasi 'flauschi'
RV-Fan__Base(base-height, base-width)
RV-Fan__Base--wurst()
+RV-Element('Löffel')
--flauschi 'löffel'
RV-Fan__Surface()
@ -118,10 +124,14 @@ RV-Fan()
RV-Fan()
RV-Fan__Surface()
RV-Fan__Surface--fixedWidth(base-width)
RV-Fan__Surface--fixedHeight(base-height)
+RV-Element__Modifier('fixedWidth')
RV-Fan__Surface--fixedWidth(base-width)
+RV-Element__Modifier('fixedHeight')
RV-Fan__Surface--fixedHeight(base-height)
RV-Fan__Base(base-height, base-width)
+RV-Element__Modifier('wurst')
RV-Fan__Base--wurst()
RV-Fan--fullWidth(base-height, base-width)
RV-Fan--vertical(base-height, base-width)