Best of CSS-TricksJanuary 2026

  1. 1
    Article
    Avatar of css_tricksCSS-Tricks·13w

    I Learned The First Rule of ARIA the Hard Way

    A developer shares their experience of breaking a button's accessibility by adding an ARIA role attribute. The button worked perfectly as native HTML, but adding role="link" caused keyboard navigation and screen reader issues. The fix was simple: remove the ARIA attribute and use CSS classes for styling instead. The key lesson is that semantic HTML already provides robust accessibility features, and ARIA should only be used to communicate missing state information, not to redefine element roles. When you override native semantics with ARIA, you take on responsibility for keyboard interactions, focus management, and cross-platform behavior.

  2. 2
    Article
    Avatar of css_tricksCSS-Tricks·12w

    CSS-Tricks

    ReliCSS is a tool that identifies outdated CSS code in your projects and suggests modern alternatives. It categorizes legacy code by severity: high (IE6/7 hacks, dangerous techniques), medium (IE8-10 hacks), and low (vendor prefixes better handled by Autoprefixer). The tool helps developers clean up technical debt like unnecessary !important declarations, checkbox hacks replaceable by :has(), and old vendor prefixes from outdated build configurations.

  3. 3
    Article
    Avatar of css_tricksCSS-Tricks·15w

    Future CSS: :drag (and Maybe ::dragged-image?)

    A proposed CSS pseudo-class `:drag` would enable styling elements during drag interactions without JavaScript. Currently, developers must use the HTML Drag and Drop API with JavaScript event listeners and class toggling to achieve this effect. The proposal would simplify the process by allowing direct CSS styling when elements are being dragged. The author also suggests a `::drag-image` pseudo-element for customizing the preview image shown during dragging, which currently requires JavaScript's `dataTransfer.setDragImage()` method. Both proposals aim to reduce JavaScript dependencies and improve performance for common drag-and-drop UI patterns.