Skip to content

Commit 2d6856c

Browse files
tomblthecrypticace
andauthored
Ensure configured font-feature-settings for mono are included in Preflight (#12342)
* Use the default font-feature-settings for mono * Update changelog * Update tests --------- Co-authored-by: Jordan Pittman <[email protected]>
1 parent c73b741 commit 2d6856c

File tree

4 files changed

+220
-209
lines changed

4 files changed

+220
-209
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- [Oxide] Fix source maps issue resulting in a crash ([#11319](https://github.com/tailwindlabs/tailwindcss/pull/11319))
1717
- [Oxide] Fallback to RegEx based parser when using custom transformers or extractors ([#11335](https://github.com/tailwindlabs/tailwindcss/pull/11335))
1818
- [Oxide] Bump `lightningcss` and reflect related improvements in tests ([#11550](https://github.com/tailwindlabs/tailwindcss/pull/11550))
19+
- Ensure configured `font-feature-settings` for `mono` are included in Preflight ([#12342](https://github.com/tailwindlabs/tailwindcss/pull/12342))
1920

2021
### Added
2122

src/css/preflight.css

+7-3
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,20 @@ strong {
102102
}
103103

104104
/*
105-
1. Use the user's configured `mono` font family by default.
106-
2. Correct the odd `em` font sizing in all browsers.
105+
1. Use the user's configured `mono` font-family by default.
106+
2. Use the user's configured `mono` font-feature-settings by default.
107+
3. Use the user's configured `mono` font-variation-settings by default.
108+
4. Correct the odd `em` font sizing in all browsers.
107109
*/
108110

109111
code,
110112
kbd,
111113
samp,
112114
pre {
113115
font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
114-
font-size: 1em; /* 2 */
116+
font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */
117+
font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */
118+
font-size: 1em; /* 4 */
115119
}
116120

117121
/*

tests/plugins/__snapshots__/preflight.test.js.snap

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ b, strong {
5353
}
5454
5555
code, kbd, samp, pre {
56+
font-feature-settings: normal;
57+
font-variation-settings: normal;
5658
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
5759
font-size: 1em;
5860
}
@@ -251,6 +253,8 @@ b, strong {
251253
}
252254
253255
code, kbd, samp, pre {
256+
font-feature-settings: normal;
257+
font-variation-settings: normal;
254258
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
255259
font-size: 1em;
256260
}

0 commit comments

Comments
 (0)