Closed mhulse closed 11 years ago
I've spent my weekend building this:
cd556d7410d168e6c8818d5aeca401098b9f2ff4
Now that I've got something working, I think I might nix this idea altogether.
Why? For multiple reasons:
nth()
will throw an error if index doesn't exist ... In other langs, you can specify a default return value in the list function so you can test/get/default all in one line. Currently, SCSS makes one jump through hoops with @if
/@else
statements in order to protect against list out of range errors.padding: #{baseline(22, .875) / 2}em;
? It would be pain in arse to account for multiplier and divisor plus the function call thingy. Ugh and ugly.For now, I guess it's good for me to have a commit to point to, just in case I want to re-visit, but I think I'm going to remove "expand" from my code and stick with things like:
.foo {
margin: #{relative(12)}rem 0;
padding: #{baseline(22, .875) / 2}em;
}
I suppose it's less readable, but at least it's more flexible.
Discussion on nth()
here:
So I can pass unlimited nums to it. Returns back relative units in same order. Add
$unit
,$divisor
and$multiplier
.