Feature Request / new formats: unitless line-heights, css/var-deep
See original GitHub issueI know you’re trying to limit new formats, so you can stop here and close the issue if you don’t want them…
I wrote a few quick formats for myself that I thought would be useful to share if people want them. If wanted I can work on an MR to pass them along.
Unitless Line Heights (when both values are provided from design in absolute units) This works better with the object transform step I filed to dynamically add the “base-font-size”
{
"typography": {
"xxs": {
"title1": {
"size": { "value": 21, "attributes": { "category": "size" } },
"line-height": { "value": 28, "base-font-size": 21 }
}
}
}
css/var/deep An output like this allows the consuming application to adjust the theme on the fly.
:root {
--kite-color-base-blue-20: #0073d1;
--kite-color-primary: var(--kite-color-base-blue-20);
--kite-border-color-primary: var(--kite-color-primary);
--kite-button-primary-background-color: var(--kite-color-primary);
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
line-height - CSS-Tricks
The line-height property defines the amount of space above and below ... is using a number value, referred to as a “unitless” line...
Read more >line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >Why does unitless line-height behave differently from ...
(Namely: a unitless value is passed to the child element and its line height is calculated using the child's font size, whereas a...
Read more >Deep dive CSS: font metrics, line-height and vertical-align
An introduction to the inline formatting context. Explores line-height and vertical-align properties, as well as the font metrics.
Read more >Nope, nope, nope, line-height is unitless - Matt Smith
When setting line-height in CSS, a common mistake is to pass a specific unit for the value. Here's why we should be following...
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 Free
Top 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
@chazzmoney, is it cool to share a link here? If not, please feel free to yell at me.
@fredriklind, I’ve pushed the code into a forked repo that I use for contributing. It’s in this folder: https://github.com/tonyjwalt/style-dictionary/tree/feature/cssVarDeep/examples/custom-formats
Please note that I’ve only written about half of the unit test; so there may be use cases it doesn’t support yet.
I know we’ve been weird about too many formats because we have concerns about being able to maintain them… but I think some of what you are doing is becoming mainstream these days and is missing. A PR provides a nice space for us to discuss.