news.volyx.in

Modern CSS Code Snippets: Stop writing CSS like it's 2015 (modern-css.com)

708 points by eustoria · 154 days ago · 305 comments on HN

Article summary

The article discusses modern CSS code snippets and how they can replace outdated CSS hacks. It provides examples of new CSS features such as grid layout, container queries, and animation triggers. The article aims to encourage developers to update their CSS skills and stop using outdated methods. By adopting modern CSS, developers can write more efficient and effective code.

Main themes

  • Modern CSS features
  • Outdated CSS hacks
  • Grid layout
  • Container queries
  • Animation triggers
  • CSS best practices

What commenters say

  • Some developers argue that using modern CSS features is not necessary and that older methods are still effective for many use cases.
  • Others believe that modern CSS features such as grid layout and container queries are essential for building efficient and responsive web applications.
  • There is a debate about the usefulness of CSS frameworks like Tailwind, with some arguing that they promote bad coding practices and others seeing them as a valuable tool for rapid development.
  • Some commenters think that the trend of writing CSS in a single file with a component is a step backwards and can lead to maintainability issues.
  • Others argue that colocation of HTML, CSS, and JavaScript in a single file can improve development velocity and reduce overhead.
  • A few commenters mention that CSS modules can help solve the problem of global CSS scope and specificity issues.
  • Some developers are concerned that the use of modern CSS features may not be compatible with older browsers and may lead to accessibility issues.
  • Others argue that the benefits of modern CSS features outweigh the potential drawbacks and that developers should prioritize using the latest technologies to build better web applications.