Skip to main content

Harshal V. LADHE

Working with Design Tokens

Using design tokens to keep colour, spacing, and typography consistent and easy to theme across a site.

Content tagged design-tokens

  • Tutorial:contrast-color(): Automatic Readable Text on Any Background

    Let CSS choose readable white or black text automatically.
    Use CSS contrast-color() to pick white or black text for any background colour: how the spec defines it, custom properties and brand colours, buttons and tags, pairing with light-dark(), mid-tone limits, and an @supports fallback.
    Published at:
    Categories:CSS
    Estimated reading time:10 min read
  • Tutorial:CSS Custom Functions with @function: Reusable Logic Without Sass

    Native, reusable CSS functions with parameters — no Sass needed.
    Define native CSS custom functions with @function: typed parameters, defaults, fallbacks for older browsers, how they differ from Sass, and when to use them.
    Published at:
    Categories:CSS
    Estimated reading time:10 min read
  • Tutorial:One-Line Theme-Aware Colors with light-dark()

    A single declaration per color, resolved automatically for both light and dark mode.
    The light-dark() CSS function collapses a light value and a dark value into one declaration, resolved by color-scheme — no duplicate custom properties, no @media (prefers-color-scheme) block per themed property.
    Published at:
    Categories:CSS
    Estimated reading time:5 min read