Text component doesn't inherit all typography styles
See original GitHub issueI’ve recently migrated to version 4 but it doesn’t look like the Text
component is inheriting all of the typography styles expected from the body
property on fonts.
See CodeSandbox example.
I’ve double-checked the implementation with your documentation, but I can’t seem to see what could be wrong. Could you provide any additional direction?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Styled component does not inherit styles when using "as ...
1 Answer 1 ; React from "react" ; import styled, {css} from "styled-components" ; import { typography, color } from "styled-system" ...
Read more >Text style inheritance overview | Webflow University
Example 1 — Inheriting styles from the Body By default, these elements inherit their text styling from the Body. You can see this...
Read more >inherit - CSS: Cascading Style Sheets - MDN Web Docs
The inherit CSS keyword causes the element to take the computed value of the property from its parent element. It can be applied...
Read more >1.1. Specifying Fonts and Inheritance - CSS Cookbook [Book]
You can enclose all font names in quotes, regardless of whether they contain spaces, ... A child element inherits, or has the same...
Read more >Inherit, initial, unset, revert - QuirksBlog - QuirksMode
The fact that an element has margin-left: 10% does not mean all of ... Using it for font sizes or colours may occasionally...
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
By default the Text component doesn’t pick up particular styles from the theme. You can extend the component if you’d like to add default styles to the component
@marozzocom Thank you for your reply. This makes sense, I have no problem extending the component or adding global styles to correct the font.
The documentation’s example is confusing. The styled-system theming suggests being able to modify the
body
font-family and font weight: (Theming: Example)What does the
body
attribute in styled-sytem themes actually modify then?Also, calling the
Text
component a “Response typography component” seems inaccurate if it doesn’t inherit the typography attributes from the theme.