So... I slept on it, and it's even worse now :)
I think WeCSS is getting a bit 'old' by my standards, and I should remove some of the dust. And maybe rename it to 'Wess', which I've been considering for a while...
- First of all, because I support 'base:' and added the 'extends' keyword to make it more objecty, I think it's only fair that I add a 'mixes' keyword that would do the exact same thing as 'mixin:'.
- Additionally, maybe mixins should be defined the same way as bases, that is, as regular selectors... (Or, at least, to enable virtuals to be used as mixins). To get the regular mixin behavior, we'd just need to define them as virtuals. The good thing is that it would mean .inline-block can be used both as a base and a mixin. Can you hear "solves the media query problem" already? Yes I'm sure you can...
- I went to check out LESS and SASS (my main 'competition' if I may say), and LESS has done a lot of progress in a year (I should have kept up with their new stuff really...). They now both support mixin parameters, and it's indeed something that could happen to be useful in WeCSS as well. I'm just trying to figure out the proper way of writing it if I'm going to use selectors for mixin declarations... Something like:
Code: [Select]
- As seen just above, there's already an undocumented feature in WeCSS which I like a lot:
background-color: ifnull($custom_color, #fff)
Meaning, "if $custom_color is set, then set background-color to it, otherwise set it to #fff".
Okay, so should this remain like this? Or would it feel more natural to use @ifnull instead of ifnull?
- Same for conditionals...
Code: [Select]
Should these keywords use @? Should whatever follows if be between brackets? if(ie) or if (ie), like in JavaScript or PHP... But maybe skin authors aren't too versed into these languages, I don't know.
Should we use @endif, too, or would indenting be enough to say "it's the end of the argument list"...? (I haven't tested for now whether or not it can allow for nested selectors in such a situation...)
Should we allow for single-line if statements?
Code: [Select]
Code: [Select]
(In which case, an @endif would mean end of statement, while a missing @endif would mean the statement ends at the end of the line.... But again, maybe it's too complicated?)
Or maybe, similarly to ifnull/@ifnull...
Code: [Select]
Just a few ideas like that. May add some in the future... Would like opinions from everyone interested in CSS in general, thank you :)
I think WeCSS is getting a bit 'old' by my standards, and I should remove some of the dust. And maybe rename it to 'Wess', which I've been considering for a while...
- First of all, because I support 'base:' and added the 'extends' keyword to make it more objecty, I think it's only fair that I add a 'mixes' keyword that would do the exact same thing as 'mixin:'.
- Additionally, maybe mixins should be defined the same way as bases, that is, as regular selectors... (Or, at least, to enable virtuals to be used as mixins). To get the regular mixin behavior, we'd just need to define them as virtuals. The good thing is that it would mean .inline-block can be used both as a base and a mixin. Can you hear "solves the media query problem" already? Yes I'm sure you can...
- I went to check out LESS and SASS (my main 'competition' if I may say), and LESS has done a lot of progress in a year (I should have kept up with their new stuff really...). They now both support mixin parameters, and it's indeed something that could happen to be useful in WeCSS as well. I'm just trying to figure out the proper way of writing it if I'm going to use selectors for mixin declarations... Something like:
.my_mixin virtual params $col = #fff, $param2...
color: $col
box-shadow: ifnull($param2, none)- As seen just above, there's already an undocumented feature in WeCSS which I like a lot:
background-color: ifnull($custom_color, #fff)
Meaning, "if $custom_color is set, then set background-color to it, otherwise set it to #fff".
Okay, so should this remain like this? Or would it feel more natural to use @ifnull instead of ifnull?
- Same for conditionals...
.class
color: #fff
@if ie6, ie7, firefox[-3.7]
background: url(border)
@else
border-radius: 5px
font-size: 1emShould these keywords use @? Should whatever follows if be between brackets? if(ie) or if (ie), like in JavaScript or PHP... But maybe skin authors aren't too versed into these languages, I don't know.
Should we use @endif, too, or would indenting be enough to say "it's the end of the argument list"...? (I haven't tested for now whether or not it can allow for nested selectors in such a situation...)
Should we allow for single-line if statements?
.class
@if (ie[-8]) background-color: #fff @else background-color: rgba(255,255,255,.8).class
background-color: @if (ie[-8]) #fff @else rgba(255,255,255,.8)(In which case, an @endif would mean end of statement, while a missing @endif would mean the statement ends at the end of the line.... But again, maybe it's too complicated?)
Or maybe, similarly to ifnull/@ifnull...
.class
background-color: @if (ie[-8], #fff, rgba(255,255,255,.8))Just a few ideas like that. May add some in the future... Would like opinions from everyone interested in CSS in general, thank you :)





