question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request | add `font-variant` / `text-transform` option to the global "font" type

See original GitHub issue

Expected Behavior

In raw CSS, I can use the following rule to make text uppercase -

text-transform: uppercase;

I could also achieve something similar using a different rule to get “small-caps” -

font-variant: small-caps;

So it would be cool to allow this to be controlled via a setting manageable for usages of fonts (e.g. on a per-heading basis). In src/js/themes/base.d.ts:

    font?: {
      face?: string;
      family?: string;
      height?: string;
      maxWidth?: string;
      size?: string;
      weight?: number | string;
      variant?: string; // Very epic new rule, I can now make my text "uppercase" so easily!
    };

Note: It is probably crazy to have the entire theme globally uppercase all fonts, but I am assuming this global::font specification is how the other font: {} definitions also work.

Actual Behavior

The current global::font object piece is in src/js/themes/base.d.ts is as follows:

    font?: {
      face?: string;
      family?: string;
      height?: string;
      maxWidth?: string;
      size?: string;
      weight?: number | string;
    };

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jcfilbencommented, Sep 13, 2022

Hey @joybh98 thanks for the update! I think you can go ahead and open up a PR and then we can look into the tests failing

1reaction
jcfilbencommented, Aug 29, 2022

is this something a beginner to this project contribute to ?

Yes! @joybh98 definitely feel free to contribute and feel free to reach out with any questions along the way!

I think for this issue we can go ahead and add variant to the global.font theme property, I just want to note for the original author of the issue that the other font definitions in the theme don’t always follow the global.font specification but we would like to eventually move in that direction (but I think that can be handled in separate issues and pull requests).

Read more comments on GitHub >

github_iconTop Results From Across the Web

font-feature-settings - CSS: Cascading Style Sheets | MDN
The font-feature-settings CSS property controls advanced typographic features in OpenType fonts.
Read more >
CSS font-variant property - W3Schools
The font-variant property specifies whether or not a text should be displayed in a small-caps font. Show demo ❯. Default value: normal. Inherited:...
Read more >
CSS Fonts Module Level 4 - W3C
Abstract. This specification defines modifications to the existing CSS Fonts 3 specification along with additional features.
Read more >
Font Family - Tailwind CSS
By default, Tailwind provides three font family utilities: a cross-browser sans-serif stack, a cross-browser serif stack, and a cross-browser monospaced stack.
Read more >
Theme.json typography options: Font family and size
Learn about the theme.json typography options for font family and font size and how to add custom google fonts with the webfonts API....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found