mhulse / rex

On, Wildfire, on!
http://mhulse.github.io/rex/demo/
Apache License 2.0
4 stars 0 forks source link

Make all placeholder vars #114

Closed mhulse closed 11 years ago

mhulse commented 11 years ago

Might be a nice way to extend. Put all classes in main css file. In other words, Rex is a lib the people can extend.

mhulse commented 11 years ago

Already thinking this might not be as easy as I thought it would be.

For example:

%natural-box {

    &:before,
    &:after {
        -webkit-box-sizing: border-box;
           -moz-box-sizing: border-box;
                box-sizing: border-box;
    }

}

* {
    @extend %natural-box;
}

... generates:

:before, :after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

This creates the output I want:

%natural-box {

    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;

}

@mixin natural-box() {

    &:before,
    &:after { @extend %natural-box; }

}

* {
    @extend %natural-box;
    @include natural-box;
}

... and the output:

*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

But the above just seems a little funky.

Going to shelve this idea for a post 2.0.0 version.

mhulse commented 11 years ago

I've started a discussion here:

Sass › Best way to write this?

mhulse commented 11 years ago

Shelving this idea for now.