Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
282 stars 76 forks source link

fix: convert breakpoints variables to values instead of strings #1458

Closed AxelPeter closed 1 year ago

AxelPeter commented 1 year ago

Changes description

Change value of Breakpoints design tokens from strings to values to be used in var()

Context

With Web Checkout, we try to rely the most on Vitamin design tokens. But i have an issue when using the breakpoints design tokens. Currently, they are strings and can't be used as value in var()

/* Don't work */
--foo: "900px";
max-width: var(--foo);

/* Works */
--foo: 900px;
max-width: var(--foo);

Checklist

Does this introduce a breaking change?

If these tokens are used as strings somewhere, it could be a breaking change. But any others design tokens are values and not strings. I've checked in the codebase any use as strings but didn't found any, so it should not be a problem here

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

lauthieb commented 1 year ago

Thanks @AxelPeter for this PR, good catch! I just checked and I think this will not have consequences for our existing consumers. So we can merge :)