vscode-textmate icon indicating copy to clipboard operation
vscode-textmate copied to clipboard

Allow CSS variables in parseTheme()

Open FredKSchott opened this issue 2 years ago • 1 comments

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: https://github.com/shikijs/shiki/pull/212 Using a theme that uses CSS variables instead of hex values: https://github.com/shikijs/shiki/issues/33#issuecomment-905953016 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.

FredKSchott avatar Aug 27 '21 05:08 FredKSchott

@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.

mallardduck avatar Dec 26 '21 16:12 mallardduck