You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TailwindCSS Plugin to integrate with Inter Typeface from Rasmus Andersson [@rsms](https://twitter.com/rsms).
3
+
TailwindCSS Plugin to integrate with Inter Typeface from Rasmus Andersson [@rsms](https://twitter.com/rsms). It adds `.font-inter` class to apply Inter font family, adjusts letter spacing for each font size according to the [Dynamic Metrics](https://rsms.me/inter/dynmetrics/) and allows to toggle font feature settings. Optionally adds `@font-face` from [https://rsms.me/inter/inter.css](https://rsms.me/inter/inter.css).
4
4
5
5
The plugin is inspired with [tailwind-plugin-inter-font](https://github.com/suburbicode/tailwind-plugin-font-inter) plugin developed by Imam Susanto [@imsus](https://github.com/imsus).
6
6
7
-
## Features
8
-
9
-
- Optionally adds `@font-face` from [https://rsms.me/inter/inter.css](https://rsms.me/inter/inter.css),
@@ -60,7 +62,7 @@ The plugin has several adjustable options.
60
62
61
63
-`a`, `b`, `c` — constants used to calculate [Dynamic Metrics](https://rsms.me/inter/dynmetrics/).
62
64
-`baseFontSize` — integer for base font size, default is `16`.
63
-
-`importFontFace` — flag to inject Inter's `@font-face` to the output, default is `false`. If `false`, you should inport Inter CSS by yourself.
65
+
-`importFontFace` — flag to inject Inter's `@font-face` to the output, default is `true`. If `false`, you should import Inter by yourself (e.g. from Google Fonts).
64
66
65
67
### Theme Configuration
66
68
@@ -90,152 +92,15 @@ module.exports = {
90
92
};
91
93
```
92
94
93
-
## Output
94
-
95
-
This package will generate CSS on components section and utilities section.
96
-
97
95
### Font Family
98
96
99
-
The plugin will add some `@font-face` declaration in base (if `importFontFace` option is set to `true`) and add `.font-inter` utility class.
100
-
101
-
```css
102
-
/* Just a copy of https://rsms.me/inter/inter.css */
The plugin will inject `@font-face` declaration from https://rsms.me/inter/inter.css (set `importFontFace` option to `false` to import font manually) and add `.font-inter` utility class.
231
98
232
99
## Font Sizes
233
100
234
-
Alongside with the default `text-lg` classes, the plugin will generate nested `text-lg` to set also letter spacing according to Inter's **Dynamic Metrics**.
101
+
Alongside with the default `text-lg` classes, the plugin will generate nested `text-lg` to set letter spacing according to Inter's **Dynamic Metrics**.
235
102
236
103
```css
237
-
/* Will be generated on @tailwind utilities; */
238
-
239
104
.font-inter.text-xs,
240
105
.font-inter.text-xs {
241
106
font-size: 0.75rem;
@@ -293,7 +158,7 @@ Alongside with the default `text-lg` classes, the plugin will generate nested `t
293
158
294
159
### Font features
295
160
296
-
Also the plugin generates utility classes which allow you to specify named font feature settings.
161
+
Also the plugin generates utility classes which allow you to specify named sets of font feature settings.
297
162
298
163
```js
299
164
// tailwind.config.js
@@ -310,7 +175,7 @@ module.exports = {
310
175
This will generate the following classes:
311
176
312
177
```css
313
-
/* This is a default classes */
178
+
/* This is default classes */
314
179
.font-inter.font-feature-normal,
315
180
.font-inter.font-feature-normal {
316
181
font-feature-settings: normal;
@@ -321,7 +186,7 @@ This will generate the following classes:
0 commit comments