style-dictionary-utils icon indicating copy to clipboard operation
style-dictionary-utils copied to clipboard

Allow `undefined` color when using `css/shadow`

Open Itherael opened this issue 1 year ago • 0 comments

When transforming shadows without a color using css/shadow, the color is set to undefined.

"custom-shadow-stroke": {
    "$type": "shadow",
    "$value": {
    "offsetX": 0,
    "offsetY": 0,
    "spread": "2px",
    "inset": true
    }
}

This will generate the following CSS:

--custom-shadow-stroke: 0 0 0 2px undefined inset;

The motivation for this empty color is to allow using two different css variables when defining a box-shadow. For example:

box-shadow: var(--custom-shadow-stroke) var(--custom-shadow-color);

Itherael avatar Oct 01 '24 09:10 Itherael