Feature Request | add `font-variant` / `text-transform` option to the global "font" type
See original GitHub issueExpected 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:
- Created a year ago
- Comments:8 (3 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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
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 theglobal.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).