• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

The factor about contrast-color | CSS-Tips

Admin by Admin
October 9, 2025
Home Coding
Share on FacebookShare on Twitter


One in every of our favorites, Andy Clarke, on the one factor preserving the CSS contrast-color() perform from true glory:

For my web site design, I selected a darkish blue background color (#212E45) and lightweight textual content (#d3d5da). This color is off-white to melt the distinction between background and foreground colors, whereas sustaining an honest degree for accessibility issues.

However right here’s the factor. The contrast-color() perform chooses both white for darkish backgrounds or black for gentle ones. A minimum of to my eyes, that distinction is just too excessive and makes studying much less snug, no less than for me.

Phrase. White and black are two very protected colours to create distinction with one other coloration worth. However the quantity of distinction between a stable white/black and some other coloration, whereas providing essentially the most distinction, will not be the very best distinction ratio total.

This was true when added a darkish coloration scheme to my private web site. The distinction between the background coloration, a darkish blue (hsl(238.2 53.1% 12.5%), and stable white (#fff) was too jarring for me.

To tone that down, I’d need one thing rather less opaque than what, say hsl(100 100% 100% / .8), or 20% lighter than white. Can’t do this with contrast-color(), although. That’s why I attain for light-dark() as an alternative:

physique {
  coloration: light-dark(hsl(238.2 53.1% 12.5%), hsl(100 100% 100% / .8));
}

Will contrast-color() help greater than a black/white duo sooner or later? The spec says sure:

Future variations of this specification are anticipated to introduce extra management over each the distinction algorithm(s) used, the use circumstances, in addition to the returned coloration.

I’m positive it’s a type of issues that ‘s simpler stated than achieved, because the “proper” quantity of distinction is extra nuanced than merely saying it’s a ratio of 4.5:1. There are person preferences to have in mind, too. After which it will get into weeds of work being achieved on WCAG 3.0, which Danny does a pleasant job summarizing in a latest article detailing the shortcomings of contrast-color().


Direct Hyperlink →

Tags: contrastcolorCSSTricks
Admin

Admin

Next Post
Traditional Stephen King E book Field Set Will get 50% Low cost At Amazon

Traditional Stephen King E book Field Set Will get 50% Low cost At Amazon

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

How Usually Do AI Assistants Hallucinate Hyperlinks? (16 Million URLs Studied)

How Usually Do AI Assistants Hallucinate Hyperlinks? (16 Million URLs Studied)

September 2, 2025
Meet Mu, the small language mannequin in command of Microsoft’s Settings AI agent

Meet Mu, the small language mannequin in command of Microsoft’s Settings AI agent

June 25, 2025

Trending.

The way to Clear up the Wall Puzzle in The place Winds Meet

The way to Clear up the Wall Puzzle in The place Winds Meet

November 16, 2025
Mistral AI Releases Voxtral TTS: A 4B Open-Weight Streaming Speech Mannequin for Low-Latency Multilingual Voice Era

Mistral AI Releases Voxtral TTS: A 4B Open-Weight Streaming Speech Mannequin for Low-Latency Multilingual Voice Era

March 29, 2026
Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

March 16, 2026
Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

January 5, 2026

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

Assault on Titan studio slammed for AI use and it will not be the final time

Assault on Titan studio slammed for AI use and it will not be the final time

April 11, 2026
New approach makes AI fashions leaner and quicker whereas they’re nonetheless studying | MIT Information

New approach makes AI fashions leaner and quicker whereas they’re nonetheless studying | MIT Information

April 11, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved