Adding textStyles to the component theme
See original GitHub issue🚀 Feature request
Please describe your request in one or two sentences.
I want to be able to define a custom theme component and give it one of my textStyles.
🧱 Problem Statement / Justification
Please provide valid reason(s) why this should added to Chakra UI.
I think this is something that should be used because we want to have an easier typography.
If this feaure is related to a problem you’ve noticed. Mention it as well
✅ Proposed solution or API
Please provide code snippets, gists, or links to the ideal design or API
This is an example of setting up the theme for a Table component.
const textStyles = {
body4: {
fontSize: '1.4rem',
fontWeight: 'bold'
lineHeight: '1.4rem',
},
}
const sizes = {
sm: {
th: {
px: '8',
py: '4',
textStyle: 'body4',
},
}
}
or
const baseStyle = {
th: {
textStyle: 'body4',
}
}
↩️ Alternatives
What alternative solutions have you considered before making this request?
📝 Additional Information
What resources (links, screenshots, etc.) do you have to assist this effort?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Use themes to share colors and font styles | Flutter
To share colors and font styles throughout an app, use themes. You can either define app-wide themes, or use Theme widgets that define...
Read more >Text and Layer Styles - Chakra UI
Style props are a way to alter the style of a component by simply passing props ... You can put these styles in...
Read more >Building a Material Theme on Android: Typography
Material Theming is a way to customize Material Components to align with your brand. A Material theme includes color, typography and shape ...
Read more >Material Design 2 in Compose - Jetpack - Android Developers
The Material Design components (buttons, cards, switches, and so on) are built on top ... A Material Theme contains color, typography and shape...
Read more >Theming with Styled Components - DEV Community 👩💻👨💻
Let's add a theme.js to hold this object, since it will grow over time. const theme = { fontSource: 'https://fonts.googleapis.
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
Actually, it was solved by using the
apply
property but wanted a better API for this:And I think a better API for this would be:
@TimKolberger Could you point me to
apply
in the documentation? This is very useful but I do not see it documented. Maybe it has been replaced?