The Pseudo-Elements Everyone Forgets: ::marker and ::selection
List bullets and text-highlight colors are both fully styleable with dedicated pseudo-elements - no list-style: none rebuilds, no browser defaults clashing with your brand.
Software Engineer
I build web applications and share what I learn along the way.
Step-by-step programming tutorials on PHP, JavaScript, Laravel, WordPress and more.
List bullets and text-highlight colors are both fully styleable with dedicated pseudo-elements - no list-style: none rebuilds, no browser defaults clashing with your brand.
Vestibular disorders make parallax and zoom animations physically unpleasant for a lot of people. Respecting the reduced-motion setting takes ten lines and is table stakes for professional work.
Gradients famously cannot be transitioned - until you teach the browser that your custom property is a color or angle. @property makes CSS variables animatable with types.
One CSS property tells the browser to skip layout and paint for off-screen sections entirely. On long pages it can cut initial rendering work dramatically - no virtualization library needed.
Sticky elements that refuse to stick are almost always trapped by an ancestor with overflow set, or a parent that is exactly as tall as they are. Here is the debugging checklist.
Stop writing a font-size media query for every breakpoint. clamp() scales type smoothly with the viewport between a floor and a ceiling you control.
Numbered steps, section headings like "2.3", even line numbers - CSS counts elements natively, updates automatically when content is reordered, and needs zero markup changes.
Designers hate focus rings on click, keyboard users need them to navigate at all. :focus-visible gives each group what they want - and browsers already use it by default.
Every site with a sticky header has the same bug: jump to #section and the heading lands underneath the header. The fix is one CSS property almost nobody knows.
A headline that wraps leaving one lonely word on the second line looks broken. text-wrap: balance makes the browser distribute the words evenly, and text-wrap: pretty fixes paragraphs.
A swipeable, momentum-friendly, accessible carousel needs no JavaScript at all. scroll-snap turns a plain overflow container into one, and it feels native because it is.
Custom checkbox hacks - hidden inputs, pseudo-element ticks, sprite images - solved a problem that accent-color now handles in a single declaration.