Comments (8)
Is there any documentation on what typography.css styles apart from text elements? I've just checked and it seems to reset lots of element's margin/padding to 0 except for margin-bottom which is set to 1.45rem. Elements like form, address and so are styled. What's the reasoning for this? It seems arbitrary and breaks my layout.
I did not expect img styling at all, and I had to search for a while before I found where the margin-bottom was coming from (suspected font awesome CSS, or normalize, but not typography).
from typography.js.
This issue is coming up on Google so I wanted to post the solution:
When you intialize the Typography.js object you can provide overrideStyles
new Typography({
overrideStyles: ({ rhythm }) => ({
img: {
marginBottom: 0
}
})
})
https://kyleamathews.github.io/typography.js/
from typography.js.
Is there a way to turn off this margin and max-width: 100% in the config?
I could only see setting this globally for all images in blogs. On other sites it interferes when trying to use image as style elements.
img {
max-width: none !important;
margin-bottom: 0 !important;
}
But I think this could lead to flakey behavior.
from typography.js.
Well !important isn't necessary if TypographyStyle is declared before other styles. I swear before the typography style was overriding my webpack loaded styles. But able to reproduce now.
from typography.js.
I'm dealing with the same problem where I wanted consistent text styling but it made my images super small with a bunch of padding in the process. Is there any clean way to disable the way it overrides image css while still getting consistent text formatting benefits?
from typography.js.
The documentation doesn't mention this though, so how are we supposed to figure this out? @KyleAMathews
from typography.js.
I'll hook on this post and refer to the solution of @aamistak. As I understand, Typography defines some default rules for tables. One is: td {text-align: left}
. In Markdown we can specify cell alignments with colons (:
). |---:|
means right align. The Markdown-Plugin generates something like this <td align="right">100</td>
.
This won't work due to Typographies inline style td {text-align: left}
. Overriding won't help either. I should completely remove this style rule.
Is there a way I can do that? I would need something like this (pseudo code)
new Typography({
overrideStyles: ({ rhythm }) => ({
td: {
textAlign: false|null // something to remove the complete rule.
}
})
})
from typography.js.
Found this issue and a workaround. #244 (comment)
It's exactly I was talking about. This will result in a feature request to allow removing rules.
from typography.js.
Related Issues (20)
- Edge browser <p> margin-bottom overrides <p> margin: 0
- Why force text-align="left" on tables? HOT 2
- Add custom scoping
- How do I override linkColor? HOT 3
- Ocean Beach theme is missing a dependency
- either overriding styles is unintuitive and under-documented or I need help
- Adding my site in the list of projects using typography.js?
- Injecting CSS reset before typography.js styles in Gatsby? HOT 2
- Google Fonts are not loaded HOT 1
- Difference between demo website and usage themes HOT 3
- Which UI Kit plays nice with Typographyjs?
- Implementing pre-fetching for Google fonts
- Adding display=swap to GoogleFont in react-typography
- Fonts only seem to work if I have them installed locally HOT 1
- Heading line-heights not the same as paragraphs?
- Chromium doesn't load fonts
- Gatsby 3.0 Dependency Error HOT 2
- Update to support React 18 HOT 4
- Support CSS variables HOT 2
- Shoelace tokens based typography
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typography.js.