Giter VIP home page Giter VIP logo

Comments (5)

anjankarmakar10 avatar anjankarmakar10 commented on May 22, 2024

@jd-carroll can you confirm what actually needs to change?

from themes.

jd-carroll avatar jd-carroll commented on May 22, 2024

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.

anjankarmakar10 avatar anjankarmakar10 commented on May 22, 2024

@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.

jd-carroll avatar jd-carroll commented on May 22, 2024

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.

vladmoroz avatar vladmoroz commented on May 22, 2024

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:

Screenshot 2023-09-01 at 12 58 00

You can see that at larger sizes the words feel like they are about to fall apart into separate letters.

Compare with Radix Themes:

image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.