CSS Modern Features
5 min read
Modern CSS highlights: :has() parent selector, native nesting, container queries, scroll-driven animations, @layer cascade control, oklch() colour space, color-mix() for blending colours, and light-dark() for dark mode.
New CSS Features (2024)
:has() — parent selector- CSS Nesting — native, no preprocessor
- Container Queries — respond to container size
- Scroll-driven animations — no JS
@layer — manage cascade layerscolor-mix() — mix colours in CSSlight-dark() — automatic dark modefield-sizing: content — auto-grow textarea