Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CSS variables in parseTheme() #154

Open
FredKSchott opened this issue Aug 27, 2021 · 1 comment
Open

Allow CSS variables in parseTheme() #154

FredKSchott opened this issue Aug 27, 2021 · 1 comment

Comments

@FredKSchott
Copy link

You can see the validation of colors as hex values here, where non-hex values are ignored: https://github.com/microsoft/vscode-textmate/blob/main/src/theme.ts#L126-L134

We are trying to add CSS variable support to Shiki: shikijs/shiki#212
Using a theme that uses CSS variables instead of hex values: shikijs/shiki#33 (comment)
But this issue is blocking this solution, and the end result is a color map of only #000000 and #FFFFFF.

Would you consider relaxing this check to support var(--xxxxxxxxx) as well? I'm sure this won't have much use inside of the VSCode editor, but it would have some important usage in the larger web ecosystem.

@mallardduck
Copy link

@FredKSchott - Take a look at the PR I've submitted.

I know Shiki has a workaround for now, however it's quite limited. I think it would be nice to improve that to be more versatile, hence I've created the PR here in hopes of helping move that along further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants