Pass styleConfig part styles to custom ClassName props
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
I am trying to style a component from an external library using Chakra multipart component theming, the component has multiple className props for each of it’s part I want to pass the part styles from the styleConfig to the part className.
Describe the solution you’d like
I want to be able to do something similar to this
export const CustomComponent= () => {
const styles = useStyleConfig('CustomComponent', {});
return (
<ExternalComponent
className={styles.container}
wrapperClassName={styles.wrapper}
// or
otherClassName={sx(styles.other)} />
);
};
Is this already possible? if so maybe we could add this to the docs.
If it’s not, what is the recommended alternative?
Describe alternatives you’ve considered
I can just write CSS classNames but I wanted to use the design tokens from the theme
Issue Analytics
- State:
- Created 3 years ago
- Comments:35 (13 by maintainers)
Top Results From Across the Web
How to include styles in React create portal - Stack Overflow
You can try these code: this.containerEl = this.externalWindow.document.createElement('div'); this.containerEl.className = 'image'; this.
Read more >Component Style - Chakra UI
The computed styles for each component part based on size , or variant . If none of these were passed, the defaultProps defined...
Read more >How to create a customized data grid using griddle-react
styleConfig : takes icons and predefined classNames and those added by plugins. Also supports custom styles. pageProperties: currentPage and pageSize (number ...
Read more >react-rating-tooltip - npm
Fully CSS customizable - Styles of Rating Counter, star-container, selected status and tooltip style,; Custom position of rating counter and ...
Read more >Goober, A Less Than 1KB Css-in-js Alternative with A Familiar ...
To create a className, you need to call css with your style rules in a tagged ... You can use a custom css...
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’ve ended up doing what @TheThirdRace suggested above, forgot to close the issue though 😅.
Thanks @TheThirdRace & @with-heart