chris-pearce / scally

Scally is a Sass-based, BEM, OOCSS, responsive-ready, CSS framework that provides you with a solid foundation for building reusable UI's quickly 🕶
https://twitter.com/scally_fw
Apache License 2.0
285 stars 20 forks source link

Add parent selector to produce correct output #208

Closed michellekondou closed 8 years ago

michellekondou commented 8 years ago

Without the parent selector the output for this:

   .foo {
     @include text-input-placeholder-color($color);
   }

is:

   .foo ::-webkit-input-placeholder {
        color: $color;
   }

with a space between class and selector whereas it should be:

   .foo::-webkit-input-placeholder {
        color: $color;
   }

with no space

chris-pearce commented 8 years ago

Thanks for fixing this @michellekondou. I'll merge this in and give it a test.

chris-pearce commented 8 years ago

Unfortunately adding & breaks Ruby Sass compilation (a good reminder to test for this) so I had to Revert this PR.

This is the Ruby Sass compilation error:

Base-level rules cannot contain the parent-selector-referencing character '&'

I didn't test LibSass compilation.

See: https://github.com/sass/sass/issues/1873.

Seems they're a few alternative options to get this working when you want to apply this mixin outside of a base-level rule.

Just a FYI: I'm focused on V3 of Scally ATM which doesn't include this mixin as it turns out Autoprefixer can handle this for you.