CSS Color Module Level 4: Every New Function (2026)
CSS Color Module Level 4 added oklch, oklab, lab, lch, hwb and color(). Here is what each function does, the exact value ranges, and 2026 browser support.
Tutorials, deep-dives, and privacy-first thinking about developer tools.
Showing 13–24 of 38 posts
CSS Color Module Level 4 added oklch, oklab, lab, lch, hwb and color(). Here is what each function does, the exact value ranges, and 2026 browser support.
How the EyeDropper API lets a web app sample any pixel on the screen, the exact JavaScript to call it, and the fallback you still need in 2026.
A developer's guide to the WCAG contrast ratio formula, the 4.5:1 AA and 7:1 AAA thresholds, large-text exceptions, and how to check color contrast in code.
RGB to HEX is base-10 to base-16 on three bytes. Here's the exact math, the JavaScript one-liners, alpha channels, and the mistakes that trip people up.
In JavaScript str.length counts UTF-16 code units, so one emoji reports 2 and a family emoji reports 11. Here is how to count emoji characters correctly.
Splitting on spaces gives the wrong count for Chinese and Japanese. Here is how to count CJK words correctly with Intl.Segmenter and character counts.
Change one word and your diff lights up the whole line red and green. Here is why line-based diff does that, and how to switch to word-level.
Five regex mistakes that make a pattern match too much — greedy .*, unescaped dots, missing anchors, loose alternation, nested quantifiers — with the fix for each.
The LCS algorithm is how a diff tool finds the fewest insertions and deletions between two texts. Here is how longest common subsequence actually works.
Ignore whitespace in a diff and you cut formatting noise — but the same flag can hide real bugs in Python, YAML, and Makefiles. Here's when to use it.
Side-by-side and unified diff show the same edits two ways. Learn how each format reads, what the @@ hunk header means, and when to pick which.
Understand regex capture groups, backreferences, and the $1, $&, and $<name> replacement tokens — with copy-paste JavaScript examples that actually work.