Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stencil): TypeScript support for variable/modifier with same key (#…
…2635) Fix TypeScript types when the variable and modifiers share the same keys. This is supported without issue at runtime, but TypeScript would throw an error. Now if the keys are the same, the types will include the modifier keys, but allow any string. For example, the following is now supported: ```tsx const myStencil = createStencil({ vars: { width: '10px', }, base({width}): { return { width: width } }, modifiers: { width: { zero: { width: '0', // overrides base styles }, }, }, }); myStencil({width: 'zero'}); // `'zero'` is part of autocomplete myStencil({width: '10px'}); // width also accepts a string ``` [category:Styling]
- Loading branch information
1 parent
c604a4e
commit b2f8a99
Showing
3 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters