normalize-opentype.css
normalize-opentype.css copied to clipboard
Add vendor prefixing to distributed Sass version?
While normalize-opentype.css includes the vendor prefixing, normalize-opentype.scss doesn’t and will work best with Autoprefixer and the like. I’m open to reevaluating how this is done, if you’re using Sass and have a strong opinion, please share your setup! One option would be a vendor-prefixed version in dist/ or dropping the Sass version entirely, as I also want to avoid confusion about which file to use.
I think the ideal solution would be if libsass added support for importing plain CSS files.
I think saying the SCSS version relies on Autoprefixer is a fine solution — these are your development files and should match your style.
As far as I know, it's as designed for Sass to just fall back to standard @import rules when you point it at a .css file so you generate an additional request. Would definitely be nice to say: "Just read this in as if it was a .scss file"
Continuing thought on this: I had a bit of a problem with the compressed output style that node-sass was giving you and you're not really taking advantage of any Sass features here. Might be best to just have it written in CSS like Normalize. People who need a Sass version could just rename the file extension or fork this. Writing it in CSS would save you from those readability issues in that outputted CSS file.
I think just using the .css version would make sense. Unless, of course, you find a use for Sass features.
At the very least, mention that .scss version needs Autoprefixer in the readme or include a vendor-prefixed version in /dist, as you said. That threw me for a bit.
I wonder if the Sass version could be made to make more use of Sass? If the font-feature-settings property is created by some mixin it would be easy enough to also have it output vendor prefixes without cluttering the rest of the code.
I’ve been trying something like that here: normalize-opentype-with-mixin.scss.
@Zegnat Hey, thanks. I appreciate you taking a stab at that but it’s not quite what I’m looking for. I actually added the font-feature-settings mixin to Bourbon—that might be a good option if you like the mixin based approach elsewhere—but Autoprefixer has increasingly become the choice for doing prefixing.
I’m using Autoprefixer to build the .css version (you can run npm run build-prefix to see it in action) but I’m still questioning whether there should be a Sass version at all (since, as you point out, I’m not using it very much). I will probably drop it at v1.0.0, or when Libsass supports importing of regular CSS files.