news.volyx.in

WebKit Supports Nested CSS (webkit.org)

519 points by gslin · 1295 days ago · 180 comments on HN

Article summary

WebKit now supports nested CSS, allowing developers to write more compact and organized code. The implementation is based on Option 3, which was chosen by web developers in a poll. Nested CSS works similarly to Sass, but with the restriction that nested selectors must start with a symbol. This feature is currently available in Safari Technology Preview and Chrome Dev, and developers are encouraged to test and provide feedback.

Main themes

  • CSS Nesting
  • Sass vs Vanilla CSS
  • Code Organization
  • Parsing Efficiency
  • Future of CSS
  • PostCSS and Tooling
  • Design Systems and Maintainability
  • Browser Support and Adoption

What commenters say

  • The adoption of nested CSS may reduce the need for Sass in future projects.
  • Requiring the '&' symbol at the start of nested selectors would improve code clarity and consistency.
  • Some developers argue that Sass is still necessary for features like mixins and loops, which are not available in vanilla CSS.
  • Others believe that the use of Sass can lead to unmaintainable and overly complex code.
  • The restriction on nested selectors starting with a symbol may be relaxed in the future, but it is currently necessary for parsing efficiency.
  • Developers are looking forward to the potential addition of features like mixins and better color functions to vanilla CSS.
  • Some argue that the use of PostCSS can help bridge the gap between current CSS limitations and future features.
  • The implementation of nested CSS is seen as a significant improvement, but some developers feel that it has taken too long to arrive.