Skip to content

Commit

Permalink
fix: theme color assignment (#6051)
Browse files Browse the repository at this point in the history
  • Loading branch information
briangregoryholmes authored Nov 8, 2024
1 parent 5c95feb commit ebc928e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web-common/src/features/themes/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ function updateColorVars(
const palette = generateColorPalette(inputColor);
// Update CSS variables
palette.forEach((c, i) => {
const hsl = c.css("hsl");

root.style.setProperty(
`--hsl-${colorVarKind}-${TailwindColorSpacing[i]}`,
hsl.slice(4, -1).split(",").join(" "),
);

root.style.setProperty(
`--color-${colorVarKind}-${TailwindColorSpacing[i]}`,
c.css(),
hsl,
);
});
}

1 comment on commit ebc928e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.