3 ms·
Ask HN: Could browsers support parsing LESS and Sass natively?
Could and should browsers (Chrome & Firefox) support native browser parsing of LESS and Sass? It would be great to not have to convert to css via a build system.
- nostrademons 11y agoMost of the best features of LESS and Sass are in proposed drafts of the CSS spec: CSS variables: http://dev.w3.org/csswg/css-variables/ http://dev.w3.org/csswg/css-variables/ Calculated expressions: https://developer.mozilla.org/en-US/docs/Web/CSS/calc https://developer.mozilla.org/en-US/docs/Web/CSS/calc Mixins are almost always used just to support multiple browser prefixes, and so they go away as features graduate from being browser-specific to making it into the spec. A number of prominent offenders (transition, transform, border-radius, box-shadow) have already done this. Nested rules are similar to <style scoped>. The latter is actually a bit more powerful, since it gives true namespacing, but it's clunkier to use. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style https://developer.mozilla.org/en-US/docs/Web/HTML/Element/st... Shadow DOM also gives style encapsulation: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM https://developer.mozilla.org/en-US/docs/Web/Web_Components/... Browser support for most of these features is pretty spotty: http://caniuse.com/#search=var http://caniuse.com/#search=var http://caniuse.com/#search=calc http://caniuse.com/#search=calc http://caniuse.com/#search=scoped http://caniuse.com/#search=scoped http://caniuse.com/#search=shadowdom http://caniuse.com/#search=shadowdom