From 1812ef87310754e50be1cd0417e291af2221c9ea Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 23 Sep 2025 09:17:40 -0400 Subject: [PATCH 1/3] Cleanup formatting --- src/styles.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/styles.js b/src/styles.js index 5371223..cbaf2fc 100644 --- a/src/styles.js +++ b/src/styles.js @@ -14,13 +14,15 @@ const opacity = (color, opacity) => { // values. let hex = color.replace('#', '') hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex - const r = parseInt(hex.substring(0, 2), 16) - const g = parseInt(hex.substring(2, 4), 16) - const b = parseInt(hex.substring(4, 6), 16) + + let r = parseInt(hex.substring(0, 2), 16) + let g = parseInt(hex.substring(2, 4), 16) + let b = parseInt(hex.substring(4, 6), 16) if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) { return `color-mix(in oklab, ${color} ${opacity}, transparent)` } + return `rgb(${r}, ${g}, ${b} / ${opacity})` } From 02c166ab8b81b1e819c48fb6ea88b819e48d9118 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 23 Sep 2025 09:17:52 -0400 Subject: [PATCH 2/3] Fix RGB syntax --- src/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles.js b/src/styles.js index cbaf2fc..f563dab 100644 --- a/src/styles.js +++ b/src/styles.js @@ -23,7 +23,7 @@ const opacity = (color, opacity) => { return `color-mix(in oklab, ${color} ${opacity}, transparent)` } - return `rgb(${r}, ${g}, ${b} / ${opacity})` + return `rgb(${r} ${g} ${b} / ${opacity})` } let defaultModifiers = { From dc051c75428be32adcfe492dc4476d489703707f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 23 Sep 2025 09:19:18 -0400 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca94e4..8c174e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Fixed broken color styles ([#405](https://github.com/tailwindlabs/tailwindcss-typography/pull/405)) ## [0.5.18] - 2025-09-19