Urgent.News

600+ sources. One page. See who else covered it.

Editions

Tech

Choosing colors (for developers)

The eleven-shade color scale from Tailwind CSS is one of those ideas I keep stealing. You know the one: 50 through 950 gives you enough stops for backgrounds, borders, hover states, text, everything. I use it even when I’m not using Tailwind. But I almost never use the defaults (your site/app ends up looking like every other site built by LLMs). The fix is not complicated. You don’t need a color…

The eleven-shade color scale from Tailwind CSS simplifies designing color schemes for backgrounds, borders, hover states, and text. Developers often customize these defaults to better fit their brand. To choose the right color, consider the purpose of the site: blues for finance and B2B sites, greens or teals for health and wellness, purples, pinks, and oranges for creative and entertainment, and reds, oranges, and warm yellows for food and hospitality.

If stuck, analyze a competitor's site or use colors from an image. Begin by sampling a prominent color from your hero photo or logo and input it into a color picker to get the OKLCH hue. You don't need a perfect first choice; iterate until you find a suitable hue. For a neutral palette, alias the chosen neutral color to --gray-* in your CSS.

This ensures consistency in your templates, regardless of the specific neutral tone. Use the OKLCH color model to derive shades from a single hue variable. This approach allows you to change the base hue and automatically generate harmonious shades without modifying every template. Adjust the lightness, chroma, and hue values to create a balanced palette, but be mindful that slight differences in hue can affect the perceived color.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Read the original at dev.to →

More in Tech

Your personal data is for sale. Privacy Bee earned PCMag's first perfect score fighting it

PCMag names Privacy Bee the first data removal service to earn a perfect 5-star rating, citing its industry-leading broker coverage and ongoing removal efforts.

  • Privacy Bee earns PCMag's first perfect 5-star rating for data removal service
  • Service removes personal data from 1,128 data brokers and over 1,100 sites
  • Privacy Bee monitors for reappearances and provides before/after screenshots