Git Product home page Git Product logo

Comments (4)

KyleAMathews avatar KyleAMathews commented on May 24, 2024

No — the API is focused on providing high-level controls over your typography e.g. changing the baseFontSize doesn't just change the body font size but it also changes the baseLineHeight which changes the size of our rhythm unit which then changes the spacing between dozens of elements.

Changing the letter spacing just changes the letter spacing. So for styles that don't have cross-cutting effects, I just use css. I do like to control styles like this with Typography.js. For my sites I have a utils/typography.js in which all global styles go. For changes like letter-spacing, see the overrideStyles API option. You can pass a function in and set arbitrary CSS. This gets called after the rest of the CSS is generated so you can add additional rules or override defaults.

from typography.js.

KyleAMathews avatar KyleAMathews commented on May 24, 2024

And a fwiw, I don't like using letter-spacing. If you want a narrower or wider letter spacing, I'd rather choose a different typeface which is more narrow. Just like you'd much rather use a real italic instead of browser's emulated italic. A number of larger font families will also include a narrow or condensed version as well.

from typography.js.

hudat avatar hudat commented on May 24, 2024

Thanks.

Agreed on the letter-spacing as a fallback option. I mostly use it out of necessity when finding a similar font that's narrower/wider isn't viable given constraints.

from typography.js.

dirtyredz avatar dirtyredz commented on May 24, 2024

@KyleAMathews can i see an example of how you include global styles inside your utils/typography.js
Im looking to add letter spacing to all my headers and am curious how you approached this as im just using a standard css file to for all h1,h2,etc

Also if you have a link to a blog/tutorial on how to use the overrideStyles id much appreciate it TY.

from typography.js.

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.