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

Getting lexical error warnings #27

Open
abensur opened this issue Aug 11, 2023 · 0 comments
Open

Getting lexical error warnings #27

abensur opened this issue Aug 11, 2023 · 0 comments

Comments

@abensur
Copy link

abensur commented Aug 11, 2023

Hi, thanks for this preset!

This daisy's toggle propertie

box-shadow: calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset, calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset, 0 0 0 2px var(--tglbg) inset

is being replaced with

box-shadow: calc(var(--handleoffset), 2) 0 0 2px var(--tglbg) inset, calc(var(--handleoffset), -2) 0 0 2px var(--tglbg) inset, 0 0 0 2px var(--tglbg) inset

I've tried changing your replaceSlash function and it worked:

// var(--foo) / 0.1 -> var(--foo)
const replaceSlash = (css: string) => css.replace(/\) \/ /g, '), ')

into

// var(--foo) / 0.1 -> var(--foo), 0.1
// but not calc(var(--foo) / 0.1)
const replaceSlash = (css: string) => css.replace(/(?<!calc\([^)]*)\) \/ (?![^(]*\))/g, '), ');
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

1 participant