Skip to content

Commit ed95206

Browse files
authored
Fix variable declaration in opacity function (#403)
Fixes bug where `hex` isn't defined due to [these recent changes](f822222#diff-f3331a84c51a6f085fad8f853ae9dc1eb9188eca02f0ff692310780e4dfc58a0R10-R16) <img width="494" height="262" alt="image" src="https://github.com/user-attachments/assets/adf93b9c-707e-4e74-abe1-c0255264808f" /> <img width="585" height="219" alt="image" src="https://github.com/user-attachments/assets/e1fd518e-89d8-4c05-a1cd-caaafd6af19b" />
1 parent 7efcb4a commit ed95206

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const opacity = (color, opacity) => {
1212
// only handled these values. We keep the old behavior for backward
1313
// compatibility with v3 codebases but use color-mix for any other color
1414
// values.
15-
hex = color.replace('#', '')
15+
let hex = color.replace('#', '')
1616
hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex
1717
const r = parseInt(hex.substring(0, 2), 16)
1818
const g = parseInt(hex.substring(2, 4), 16)

0 commit comments

Comments
 (0)