Comments (5)
@jd-carroll can you confirm what actually needs to change?
from themes.
Not sure I follow, I believe I was asking a question
But, assuming I am correct (which I may well not be), each value should be multiplied by -1 (letters get closer together the smaller they are and a little further apart the bigger they are)
from themes.
@jd-carroll yes it makes no sense why they use negative number --letter-spacing-4: -0.0025em; --letter-spacing-5: -0.005em; --letter-spacing-6: -0.00625em; --letter-spacing-7: -0.0075em; --letter-spacing-8: -0.01em; --letter-spacing-9: -0.025em;
from themes.
So I'll answer my own question, but it would be great if someone from the Radix team could answer / confirm...
The "inversed" spacing is actually designed to keep more of a "pixel-perfect" design than provide "traditional" letter spacing. As the font size increases, any em
based letter-spacing
would naturally make the absolute difference (px
) between letters larger. The letter-spacing tokens are designed to offset the naturally increasing spacing to have more of an absolute (px
) difference between letters, that is to say constant difference.
(Note: The default letter spacing for each font-family is em
based.)
from themes.
This letter spacing scale is an intentional design detail and a pretty common practice in typesetting—the larger the font, the tighter it is spaced to look even and balanced.
Here’s a certain component library that doesn't adjust letter spacing as the font size increases:
You can see that at larger sizes the words feel like they are about to fall apart into separate letters.
Compare with Radix Themes:
The letters flock together at large sizes, forming words and establishing a punchy rhythm to the text.
Also, if Heading is supposed to get closer as it grows in size, could simply do something like:
letter-spacing: calc(-var(--letter-spacing-9) - var(--heading-letter-spacing));
Variables like --heading-letter-spacing
, --em-letter-spacing
, --code-letter-spacing
, etc are just a tool we provide to harmonise custom fonts when used in components like Heading, Em, Code, etc with your default font in Text and most other components. You can use negative values on the variables themselves if that's what you need.
from themes.
Related Issues (20)
- [Layout] Extract layout to separated package HOT 5
- Button's ghost variant has inconsistent padding HOT 3
- TextField autofocus HOT 1
- [Feature Request] Accordion
- Cannot find module `@radix-ui\themes\dist\cjs` HOT 2
- [Switch] Issue- Screen readers announce "Button" instead of "Switch". HOT 1
- [Tooltip] Issue: Text inside is based on theme
- Button vanishes after adding type HOT 1
- [Dialog] Issue
- [Avatar] Conditionally set color HOT 3
- [Question] Why separate layout, margin and another props? HOT 1
- [DropdownMenu] Issue- Dropdown can't be navigated with TAB key HOT 2
- Left align Radio Card HOT 1
- Select Trigger Color Prop Broken HOT 1
- Improve documentation on customizing the CSS variables (e.g. the Container max widths) HOT 1
- [SegmentedControl] Disabled items not supported HOT 1
- [Question] accordions expanding with code HOT 1
- [Alert Dialog] - dialog has no close button
- Dialog in Dropdown Menu: Space Bar Not Working in Inputs HOT 5
- [RadioCards] Issue with import RadioCard HOT 1
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 themes.