Skip to content

Commit

Permalink
Ensure configured font-feature-settings for mono are included in …
Browse files Browse the repository at this point in the history
…Preflight (#12342)

* Use the default font-feature-settings for mono

* Update changelog

* Update tests

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
  • Loading branch information
tombl and thecrypticace committed Nov 2, 2023
1 parent c73b741 commit 2d6856c
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 209 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Oxide] Fix source maps issue resulting in a crash ([#11319](https://github.com/tailwindlabs/tailwindcss/pull/11319))
- [Oxide] Fallback to RegEx based parser when using custom transformers or extractors ([#11335](https://github.com/tailwindlabs/tailwindcss/pull/11335))
- [Oxide] Bump `lightningcss` and reflect related improvements in tests ([#11550](https://github.com/tailwindlabs/tailwindcss/pull/11550))
- Ensure configured `font-feature-settings` for `mono` are included in Preflight ([#12342](https://github.com/tailwindlabs/tailwindcss/pull/12342))

### Added

Expand Down
10 changes: 7 additions & 3 deletions src/css/preflight.css
Expand Up @@ -102,16 +102,20 @@ strong {
}

/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
font-size: 1em; /* 2 */
font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */
font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */
font-size: 1em; /* 4 */
}

/*
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/__snapshots__/preflight.test.js.snap
Expand Up @@ -53,6 +53,8 @@ b, strong {
}
code, kbd, samp, pre {
font-feature-settings: normal;
font-variation-settings: normal;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
font-size: 1em;
}
Expand Down Expand Up @@ -251,6 +253,8 @@ b, strong {
}
code, kbd, samp, pre {
font-feature-settings: normal;
font-variation-settings: normal;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
font-size: 1em;
}
Expand Down

0 comments on commit 2d6856c

Please sign in to comment.