How to extend ColorVariant, ButtonVariant, etc.?
See original GitHub issueWhat you are trying to do I can extend bootstrap using scss. For example, add my own colors, sizes, etc. But I can’t use them.
What you have already tried
<b-button variant="purple">Purple button</b-button>
Any error messages you are getting TS2322: Type ‘“purple”’ is not assignable to type ‘ButtonVariant | undefined’.
Environment:
- OS: MacOS Monterey 12.6
- Version: 0.3.12
Issue Analytics
- State:
- Created a year ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
extending variants · Discussion #2974 · chakra-ui ... - GitHub
Hi @chasinhues - I would like to change the default _hover and _active shades for button variants dynamically for each colorScheme color.
Read more >How do I globally override variant, color, style, etc. for Material ...
You can do this with global overrides for your theme.
Read more >How to create visual variants for React components using ...
Meaning you need the component to change, perhaps, color to convey different information. For example: A button can be normal, primary, ...
Read more >Color Variants | Reference - BootstrapVue
Color variants available when using the default Bootstrap v4 CSS and their mappings to CSS classes.
Read more >Understanding Theme UI: 6 - The Hacks - Paul Scanlon
You can use this approach for as many button variants as you require, but do always "extend" using the variant before applying new...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll review it again in the morning and go from there
I was exploring and couldn’t find much on using unions to extend the ButtonVariant type. I think it is the only solution right now but there is a typescript doc for extending namespaces. It is a very transparent change so I don’t mind merging it until something better comes along .