code-hike / codehike

Build rich content websites with Markdown and React
https://codehike.org
MIT License
4.74k stars 145 forks source link

Allow custom css properties in tokenColors in theme.js #328

Closed saltcod closed 1 year ago

saltcod commented 1 year ago

Hey Rodrigo!

Wondering if there's anything we can do to use custom properties in our tokenColours objects of the theme.js file.

The theme file is here: https://github.com/supabase/supabase/blob/a59e76dd1d5345cda1e2f79f28597bc822e0f39d/apps/docs/codeHikeTheme.js

The issue is that we can use custom properties in colors: {} but not in tokenColors: [{}]

The values in tokenColors get computed to rgb before being output in inline styles. But that doesn't happen with the colors: {} values.

Any ideas?

CleanShot 2023-03-07 at 22 49 09@2x

pomber commented 1 year ago

Hi, it's not possible. It was kind of possible before v0.8.0 if you really need it. See this post: https://sdorra.dev/posts/2023-01-12-ch-dark-mode.

Do you need it for light/dark mode? or is another use case?

gregnr commented 1 year ago

IIUC, this should be fixed as of https://github.com/code-hike/lighter/pull/25

pomber commented 1 year ago

IIUC, this should be fixed as of code-hike/lighter#25

True, official support with docs and everything is coming very soon. I'll close this one, you can track it with #271