Workday/canvas-kit

Type inference for stencil variables and modifiers with the same key

Closed this issue · 0 comments

💡 Suggestion

I would like to be able to use the same key for a variable and a modifier when creating a stencil. This currently functions, but lacks full type inference suppost.

Motivation

The purpose of using the same key is accepting a wide range of possible values as a variable (for example, space tokens or font sizes) but then having special values like 'none' or 'disabled' that cause some special behavior or a side effect.

Example

Example of a use case

In this use case, I want to be able to pass a wide range of possible widths, but then pass a special 'none' width that would have a side effect (setting display: none).