<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CSS contrast-color is newly baseline, but it falls short in some areas.]]></title><description><![CDATA[<p>CSS contrast-color is newly baseline, but it falls short in some areas. Here's how it works, and what to look out for:</p>

<div class="row mt-3"><div class="col-12 mt-3"><div class="ratio ratio-16x9">
<video controls width="1080" height="1920">
<source src="https://files.mastodon.social/media_attachments/files/116/403/672/677/301/023/original/a81892267c9c873f.mp4" type="video/mp4"></source>
</video>
</div></div></div>]]></description><link>https://board.circlewithadot.net/topic/74359cb7-e7e9-407f-a5ec-e905320232ef/css-contrast-color-is-newly-baseline-but-it-falls-short-in-some-areas.</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 04:51:42 GMT</lastBuildDate><atom:link href="https://board.circlewithadot.net/topic/74359cb7-e7e9-407f-a5ec-e905320232ef.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Apr 2026 15:05:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Wed, 15 Apr 2026 07:58:55 GMT]]></title><description><![CDATA[<p><span><a href="/user/simevidas%40mastodon.social">@<span>simevidas</span></a></span> I was actually shocked whisperx picked it up correctly.</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116407660410048104</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116407660410048104</guid><dc:creator><![CDATA[firefoxwebdevs@mastodon.social]]></dc:creator><pubDate>Wed, 15 Apr 2026 07:58:55 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 23:12:21 GMT]]></title><description><![CDATA[<p><span><a href="/user/firefoxwebdevs%40mastodon.social">@<span>firefoxwebdevs</span></a></span> Thanks for reminding me how to pronounce WCAG</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/users/simevidas/statuses/116405589854586443</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/users/simevidas/statuses/116405589854586443</guid><dc:creator><![CDATA[simevidas@mastodon.social]]></dc:creator><pubDate>Tue, 14 Apr 2026 23:12:21 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:52:34 GMT]]></title><description><![CDATA[<p><span><a href="/user/firefoxwebdevs%40mastodon.social" rel="nofollow noopener">@<span>firefoxwebdevs</span></a></span> <span><a href="https://me.dm/@khamer" rel="nofollow noopener">@<span>khamer</span></a></span> yeah, iirc I tweaked the formula a bit, but I also did some unit conversion, so it's harder to see that.</p>]]></description><link>https://board.circlewithadot.net/post/https://infosec.exchange/users/adamhotep/statuses/116404096525867340</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://infosec.exchange/users/adamhotep/statuses/116404096525867340</guid><dc:creator><![CDATA[adamhotep@infosec.exchange]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:52:34 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:51:03 GMT]]></title><description><![CDATA[<p><span><a href="/user/adamhotep%40infosec.exchange">@<span>adamhotep</span></a></span> <span><a href="https://me.dm/@khamer">@<span>khamer</span></a></span> that's cool, but just be aware of the cases where WCAG gets it wrong (that page uses WCAG)</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116404090553109783</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116404090553109783</guid><dc:creator><![CDATA[firefoxwebdevs@mastodon.social]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:51:03 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:35:46 GMT]]></title><description><![CDATA[<p><span><a href="/user/firefoxwebdevs%40mastodon.social" rel="nofollow noopener">@<span>firefoxwebdevs</span></a></span> <span><a href="https://me.dm/@khamer" rel="nofollow noopener">@<span>khamer</span></a></span> Here's a useful resource for checking color contrast: <a href="https://webaim.org/resources/linkcontrastchecker/" rel="nofollow noopener"><span>https://</span><span>webaim.org/resources/linkcontr</span><span>astchecker/</span></a></p><p>In <a href="https://github.com/adamhotep/nofus.js/blob/main/nofus-dialog.js#L87" rel="nofollow noopener">my own code</a>, and I'm ashamed I didn't save links to how I found these values, I calculate contrast-color manually in JS like this (assuming values for the background's <code>r</code>, <code>b</code>, and <code>g</code> of 0-255):</p><pre><code>let luminance = r / 1199 + g / 357 + b / 3532; // 0-1<br />let foreground = luminance &gt; .63 ? "#000" : "#fff";<br /></code></pre><p>I also emphasize it more with text shadow, giving a subtly glowing outline around the text:</p><pre><code>elem.style.textShadow = "0 0 .3ex " + (luminance &gt; .63 ? "#fff" : "#000");<br /></code></pre>]]></description><link>https://board.circlewithadot.net/post/https://infosec.exchange/users/adamhotep/statuses/116404030411241769</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://infosec.exchange/users/adamhotep/statuses/116404030411241769</guid><dc:creator><![CDATA[adamhotep@infosec.exchange]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:35:46 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:09:42 GMT]]></title><description><![CDATA[<p><span><a href="/user/firefoxwebdevs%40mastodon.social">@<span>firefoxwebdevs</span></a></span> <br />For folks reading into this thread, understand that APCA is not part of any W3C spec, draft or otherwise:<br /><a href="https://adrianroselli.com/2026/04/wcag3-contrast-as-of-april-2026.html" rel="nofollow noopener"><span>https://</span><span>adrianroselli.com/2026/04/wcag</span><span>3-contrast-as-of-april-2026.html</span></a></p><p>You can still use APCA (whichever APCA version), but the colors you choose may not satisfy WCAG. Be sure to also check them against WCAG.</p><p><span><a href="https://me.dm/@khamer">@<span>khamer</span></a></span></p>]]></description><link>https://board.circlewithadot.net/post/https://toot.cafe/users/aardrian/statuses/116403927925833235</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://toot.cafe/users/aardrian/statuses/116403927925833235</guid><dc:creator><![CDATA[aardrian@toot.cafe]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:09:42 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:06:45 GMT]]></title><description><![CDATA[<p><span><a href="/user/vrugtehagel%40mastodon.social">@<span>vrugtehagel</span></a></span> yesss, you can also use similar tricks to approximate APCA <a href="https://random-stuff.jakearchibald.com/color-contrast/#2277d3" rel="nofollow noopener"><span>https://</span><span>random-stuff.jakearchibald.com</span><span>/color-contrast/#2277d3</span></a></p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116403916354996665</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116403916354996665</guid><dc:creator><![CDATA[firefoxwebdevs@mastodon.social]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:06:45 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 16:02:05 GMT]]></title><description><![CDATA[<p>You can often get a better result using this trick with oklch() by <span><a href="https://me.dm/@khamer">@<span>khamer</span></a></span> which approximates APCA <a href="https://random-stuff.jakearchibald.com/color-contrast/#2277d3" rel="nofollow noopener"><span>https://</span><span>random-stuff.jakearchibald.com</span><span>/color-contrast/#2277d3</span></a></p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116403898019901689</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/115667120638353806/statuses/116403898019901689</guid><dc:creator><![CDATA[firefoxwebdevs@mastodon.social]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:02:05 GMT</pubDate></item><item><title><![CDATA[Reply to CSS contrast-color is newly baseline, but it falls short in some areas. on Tue, 14 Apr 2026 15:46:13 GMT]]></title><description><![CDATA[<p><span><a href="/user/firefoxwebdevs%40mastodon.social">@<span>firefoxwebdevs</span></a></span> fun fact, you can (kind of) make it output colors other than white or black, using relative color syntax! For example, if you wanted yellow instead of white (for whatever reason), you could do `rgb(from contrast-color(var(--my-color)) r g 0)`. This doesn't account for the changed color when deciding the most contrasty color, though, so I reckon this is only useful for very minor color changes (like a slightly off-white or nearly-black).</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/users/vrugtehagel/statuses/116403835617643425</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/users/vrugtehagel/statuses/116403835617643425</guid><dc:creator><![CDATA[vrugtehagel@mastodon.social]]></dc:creator><pubDate>Tue, 14 Apr 2026 15:46:13 GMT</pubDate></item></channel></rss>