Text Style Not Applying Unless Property Is Defined #3612 - GitHub
-
Uh oh!
There was an error while loading. Please reload this page.
- Notifications You must be signed in to change notification settings
- Fork 3.6k
- Star 40.4k
- Code
- Issues 5
- Pull requests 16
- Discussions
- Actions
- Security 0
- Insights
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote replyforrest-keller Mar 18, 2021
-
| I am running into an issue where if I define a textStyle as follows: h1: { fontSize: "100px" }It works, but only when I define the fontSize property on my component as such: <Heading fontSize="100px" textStyle="h1">Test</Heading> Any tips on why this might be happening? Everything else seems to be working all right. |
Beta Was this translation helpful? Give feedback.
5 You must be logged in to vote 👍 1 All reactions- 👍 1
Replies: 2 comments 3 replies
- Oldest
- Newest
- Top
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote replymalashevskyi Mar 18, 2021
-
| Because chakra has default styles for Heading component and it overrides your styles. "I am running into an issue where if I define a textStyle as follows:" Where do you define your styles? |
Beta Was this translation helpful? Give feedback.
2 You must be logged in to vote All reactions 2 repliesUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote replyspidertwin2 May 16, 2021
-
| Hi, In theme.ts, I am unable to customise fontWeight and fontSize. Other props are working fine. import { extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ textStyles: { pageSubHeading: { fontSize: ["md", "l", "xl"], letterSpacing: "0.5px", color: "gray.400", fontWeight: "300", }, } }) export default customTheme🌵 |
Beta Was this translation helpful? Give feedback.
All reactionsUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote replyspidertwin2 May 18, 2021
-
| I just realized textStyle does not work on <Heading>. Changed it to <Text> and then it works. |
Beta Was this translation helpful? Give feedback.
👍 8 All reactions- 👍 8
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote reply editedUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jcespinoza Nov 11, 2021
-
| Borrowing from this conversation, in my case I managed to make it respect my fontSize and fontWeight by defining them with dashes on the theme literal like so: { textStyles: { formLabels: { 'font-size': '16px', 'font-weight': '400', lineHeight: '14px' } } }Strangely enough, `lineHeight' was respected without this hack. |
Beta Was this translation helpful? Give feedback.
0 You must be logged in to vote ❤️ 2 All reactions- ❤️ 2
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Quote replyprimos63 Nov 11, 2021
-
| These are the theme properties for form-label const baseStyle: SystemStyleObject = { fontSize: "md", marginEnd: 3, mb: 2, fontWeight: "medium", transitionProperty: "common", transitionDuration: "normal", opacity: 1, _disabled: { opacity: 0.4, }, }Your textStyle works because for the formLabels fontSize and not font-size is defined so the match fails (same for font-weight). You didn't have to do that for lineHeight because it isn't defined in the base style. I have a PR for this issue. It just hasn't gone through yet. |
Beta Was this translation helpful? Give feedback.
All reactions Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Category 🙏 Q&A Labels None yet 5 participants- Heading
- Bold
- Italic
- Quote
- Code
- Link
- Numbered list
- Unordered list
- Task list
- Attach files
- Mention
- Reference
Uh oh!
There was an error while loading. Please reload this page.
Create a new saved reply 👍 1 reacted with thumbs up emoji 👎 1 reacted with thumbs down emoji 😄 1 reacted with laugh emoji 🎉 1 reacted with hooray emoji 😕 1 reacted with confused emoji ❤️ 1 reacted with heart emoji 🚀 1 reacted with rocket emoji 👀 1 reacted with eyes emoji You can’t perform that action at this time.Từ khóa » Chakra Ui H1
-
Heading - Chakra UI
-
Text And Layer Styles - Chakra UI
-
Heading - Chakra UI | Design System Built With React
-
Text - Chakra UI
-
Chakra Factory
-
Global Styles - Chakra UI
-
Heading - Chakra UI
-
Chakra UI Prose
-
How Do I Preserve The Styling Of H2, H3, Etc? Problem ... - GitHub
-
Chakra UI Test - StackBlitz
-
Advanced Techniques In Chakra UI - LogRocket Blog
-
Choc UI: Chakra UI Prebuilt Components
-
Unit Testing On NextJS + Chakra-UI Project - Stack Overflow
-
Chakra Ui Button Not Rendering - Stack Overflow