mirror of
https://github.com/hanzoai/tailwindcss-typography.git
synced 2026-09-24 17:03:19 +00:00
+3
-1
@@ -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
|
||||
|
||||
|
||||
+6
-4
@@ -14,14 +14,16 @@ 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})`
|
||||
|
||||
return `rgb(${r} ${g} ${b} / ${opacity})`
|
||||
}
|
||||
|
||||
let defaultModifiers = {
|
||||
|
||||
Reference in New Issue
Block a user