Skip to content

Shadow tokens that use a rgba() output colors as rgba(#hex, ..) #88

Open
@six7

Description

@six7

It seems that shadow tokens that use a rgba() value won't transform the used value inside the rgba() function. That means if my tokens reference a hex value, we don't currently change that hex value to the required rgba() equivalent.

{
    "base": {
        "value": "#fff",
        "type": "color"
    },
        "rgb": {
        "value": "rgb(0, 0, 0)",
        "type": "color"
    },
    "shadow": {
        "type": "boxShadow",
        "value": [
            {
                "x": "0",
                "y": "1px",
                "blur": "1px",
                "spread": "0",
                "color": "rgba({rgb}, 0.15)",
                "type": "dropShadow"
            },
            {
                "x": "0",
                "y": "2px",
                "blur": "0",
                "spread": "0",
                "color": "rgba({base}, 0.15)",
                "type": "innerShadow"
            }
        ]
    }
}

Actual output

--sdShadow: 0 1px 1px 0 rgba(rgb(0, 0, 0), 0.15), 0 2px 0 0 rgba(#fff, 0.15);

Expected output

--sdShadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 2px 0 0 rgba(255, 255, 255, 0.15);

Configurator link

https://configurator.tokens.studio/#project=rVPdbsIgFH6Vht2oYVWX7MYX2O2SXVqz0ALK1kED1Gmavvs4pazFTecSG0I45/vO3wdtUKEkF9v0zSiJVqjJZJJkyKhaFyxDq2QNDnDNZvNZatU7k6YjZwiQDfYBVUksV/rDQEwTYgoztsFjNZEGiE9a1RWAztclvTe2pkJlCA/sSjMuDp5laATltSjpM7E7j3bm3NWbRywuSmZGY8DXDEegUGaskMQKGAlSve6JFiR3gWnXP4750Dyxngr1vtleEP+14bjxh852W4sw8nOOpQy6d3MRwyLNwLknZc18yTvOedST0+9Y9WChSqVDH21E0tv8UloHTxY4gTX9X3p3MztC1eeP7ENcrg4vPQf/Wn89lvjkhgK5fwaLkwsJ8NHDy+pwhpCXtf6LY9yDI/RyoV6EXjQyadzeOtnS5eP0TMigBNWqClLEzBbfTIOHKzRY3FIBeLNXSyCkZPqMBoM5/DduofYL

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions