Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

4330 bites

Page 144

CSS & Design Systems1 min read

Roll out a design system color change

Update the token source, rebuild outputs, version and publish, bump the app's dependency, verify contrast and visual regressions.

CSS & Design Systems1 min read

Accessibility built into a Modal component

Trap focus in the modal, return focus on close, escape to dismiss, role dialog with aria-modal and a labelled title, inert background.

CSS & Design Systems1 min read

Support a one-off that deviates from the system

Offer sanctioned escape hatches like custom-property overrides, scope the one-off to the app not the library, track it for promotion or removal.

CSS & Design Systems1 min read

Versioning a design system library

Monolithic versioning is simple and coherent but couples unrelated changes; independent versioning gives granular upgrades but adds tooling complexity.

CSS & Design Systems1 min read

Architect themes on a token foundation

Separate primitive tokens from semantic alias tokens that themes redefine, emit semantics as custom properties per theme scope, components use only semantics.

CSS & Design Systems1 min read

Light and dark themes with design tokens

A shared primitives file plus per-theme semantic files, transformed into custom properties scoped by selector, components read the semantics.

CSS & Design Systems2 min read

Token architecture for white-label multi-brand

A shared semantic schema, per-brand primitive and mapping overrides, a build step emitting one bundle per brand, components consume stable semantic names.

CSS & Design Systems1 min read

Modeling responsive design tokens

Model a token as a breakpoint-to-value map, transform into a base custom property redefined in media queries, components use one var per viewport.

CSS & Design Systems2 min read

Integrating design tokens with Tailwind CSS

Feed tokens into Tailwind's theme config (or v4 CSS theme) so utilities derive from one source; a parallel setup causes drift.

CSS & Design Systems1 min read

Reusable Button with hover, focus, disabled

Use a real <button>, style :hover, a visible :focus-visible ring, and the [disabled] attribute that also blocks interaction.

CSS & Design Systems2 min read

Designing a Card component API

Simple props for title and image, but children or slots for arbitrary content instead of a string prop, keeping it composable.

CSS & Design Systems1 min read

Customize a Button without !important

Expose CSS custom properties as a styling API, accept className or style overrides, keep internal selectors low specificity so overrides win cleanly.

CSS & Design Systems1 min read

Accessible composite TextField component

Associate label and input via matching for and id, generate a unique id, spread remaining props onto the native input.

CSS & Design Systems2 min read

CSS Modules versus Styled Components

CSS Modules scope via build-time hashed class names with near-zero runtime; Styled Components scope via runtime CSS-in-JS with easy dynamics but a runtime cost.

CSS & Design Systems1 min read

Controlled vs uncontrolled Modal component

Uncontrolled is convenient but inflexible, controlled gives parent full power and predictability, and a hybrid supports both.

CSS & Design Systems1 min read

The polymorphic 'as' prop pattern

Render the element from an as prop, infer props from the chosen element, and forward refs.

CSS & Design Systems1 min read

Shadow DOM encapsulation vs CSS Modules

Shadow DOM creates a separate tree blocking selectors both ways, CSS Modules only rename classes, and global styles need explicit bridges.

CSS & Design Systems1 min read

Associating a label with a form input

Explicit association via for and id, implicit by wrapping the input, and why this gives screen readers an accessible name and larger click target.

CSS & Design Systems1 min read

Managing focus in an accessible modal dialog

Move focus in on open, trap Tab within the dialog, close on Escape, and restore focus to the trigger on close.

CSS & Design Systems1 min read

ARIA roles for an accessible tab interface

Tablist contains tabs, each tab uses aria-selected and aria-controls, panels use role tabpanel with aria-labelledby, and arrow keys move between tabs.