db-ui / mono

DB UX Design System Monorepo - Provides Design Tokens and components for Web UIs
https://db-ui.github.io/mono/review/main/
Apache License 2.0
35 stars 6 forks source link

Invalid CSS is generated: Unexpected token Function("var") #2727

Closed Mydayyy closed 1 day ago

Mydayyy commented 1 week ago

Greetings

Which generators are impacted?

Reproduction case

The file db-ui-42.css contains invalid css.

  1. Search for this selector inside the file: dialog:not([data-backdrop=none])::backdrop
  2. Locate the background-color style inside the selector
  3. That style is assigned the value var(var(--db-current-color-enabled), var(--db-neutral-on-bg-enabled)) which is invalid

    Expected Behaviour

The file db-ui-42.css should not contain invalid css.

Screenshots

image Screenshot 2024-06-07 at 12 57 12

Browser version

None

Add any other context about the problem here.

The source of the problem can be found here: https://github.com/db-ui/mono/blob/c5b4478d08fdd293b19f0b661a42fc28223e4ca6/packages/components/src/styles/dialog-init.scss#L30

which in turns gets assigned the variable declared here: https://github.com/db-ui/mono/blob/c5b4478d08fdd293b19f0b661a42fc28223e4ca6/packages/components/src/styles/dialog-init.scss#L3

And ends up having the invalid nested var(var(... assignment

Best Regards Mydayyy

annsch commented 1 week ago

I have the same problem in my project ;)

dkolba commented 1 week ago

Sass in one picture this-is-fine_wide-4a729b43a69f924bb86eb688b8f3bb38ff19be3b

mfranzke commented 1 week ago

I have the same problem in my project ;)

what a coincidence