Skip to content

Commit 0697206

Browse files
synecdokeyRobinMalfait
authored andcommitted
feat(preflight): simplify sans-serif font stack (#11748)
* feat(preflight): simplify sans-serif font stack `-apple-system` and `BlinkMacSystemFont` were historically needed for IE11 and chakra-based Edge (The one that wasn't chromium-based). https://caniuse.com/font-family-system-ui has more details around it. * further simplify `font-family` * update tests * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent b215f13 commit 0697206

10 files changed

+304
-313
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Add `appearance-auto` utility ([#12404](https://github.com/tailwindlabs/tailwindcss/pull/12404))
2424
- Add logical property values for `float` and `clear` utilities ([#12480](https://github.com/tailwindlabs/tailwindcss/pull/12480))
2525

26+
### Changed
27+
28+
- Simplify the `sans` font-family stack ([#11748](https://github.com/tailwindlabs/tailwindcss/pull/11748))
29+
2630
## [3.3.7] - 2023-12-18
2731

2832
### Fixed

src/css/preflight.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ html,
3232
-webkit-text-size-adjust: 100%; /* 2 */
3333
-moz-tab-size: 4; /* 3 */
3434
tab-size: 4; /* 3 */
35-
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
35+
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
3636
font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
3737
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
3838
}

stubs/config.full.js

-7
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,6 @@ module.exports = {
303303
sans: [
304304
'ui-sans-serif',
305305
'system-ui',
306-
'-apple-system',
307-
'BlinkMacSystemFont',
308-
'"Segoe UI"',
309-
'Roboto',
310-
'"Helvetica Neue"',
311-
'Arial',
312-
'"Noto Sans"',
313306
'sans-serif',
314307
'"Apple Color Emoji"',
315308
'"Segoe UI Emoji"',

tests/basic-usage.oxide.test.css

+2-3
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,8 @@
767767
vertical-align: middle;
768768
}
769769
.font-sans {
770-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
771-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
772-
Noto Color Emoji;
770+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
771+
Segoe UI Symbol, Noto Color Emoji;
773772
}
774773
.text-2xl {
775774
font-size: 1.5rem;

tests/basic-usage.test.css

+2-3
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,8 @@
785785
vertical-align: middle;
786786
}
787787
.font-sans {
788-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
789-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
790-
Noto Color Emoji;
788+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
789+
Segoe UI Symbol, Noto Color Emoji;
791790
}
792791
.text-2xl {
793792
font-size: 1.5rem;

tests/kitchen-sink.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ crosscheck(({ stable, oxide }) => {
240240
stable.expect(result.css).toMatchFormattedCss(css`
241241
.theme-test {
242242
color: #3b82f6;
243-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
244-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji,
243+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
245244
Segoe UI Symbol, Noto Color Emoji;
246245
}
247246
@media (min-width: 1024px) {
@@ -813,8 +812,7 @@ crosscheck(({ stable, oxide }) => {
813812
oxide.expect(result.css).toMatchFormattedCss(css`
814813
.theme-test {
815814
color: #3b82f6;
816-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
817-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji,
815+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
818816
Segoe UI Symbol, Noto Color Emoji;
819817
}
820818
@media (min-width: 1024px) {

tests/raw-content.oxide.test.css

+2-3
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,8 @@
512512
vertical-align: middle;
513513
}
514514
.font-sans {
515-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
516-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
517-
Noto Color Emoji;
515+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
516+
Segoe UI Symbol, Noto Color Emoji;
518517
}
519518
.text-2xl {
520519
font-size: 1.5rem;

tests/raw-content.test.css

+2-3
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,8 @@
524524
vertical-align: middle;
525525
}
526526
.font-sans {
527-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
528-
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
529-
Noto Color Emoji;
527+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
528+
Segoe UI Symbol, Noto Color Emoji;
530529
}
531530
.text-2xl {
532531
font-size: 1.5rem;

tests/resolveConfig.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ crosscheck(() => {
150150
'grey-lighter': '#f1f5f8',
151151
},
152152
fonts: {
153-
sans: ['system-ui', 'BlinkMacSystemFont', '-apple-system', 'Roboto', 'sans-serif'],
153+
sans: ['system-ui', 'Roboto', 'sans-serif'],
154154
serif: ['Constantia', 'Lucida Bright', 'Georgia', 'serif'],
155155
},
156156
screens: {
@@ -176,7 +176,7 @@ crosscheck(() => {
176176
'grey-lighter': '#f1f5f8',
177177
},
178178
fonts: {
179-
sans: ['system-ui', 'BlinkMacSystemFont', '-apple-system', 'Roboto', 'sans-serif'],
179+
sans: ['system-ui', 'Roboto', 'sans-serif'],
180180
serif: ['Constantia', 'Lucida Bright', 'Georgia', 'serif'],
181181
},
182182
screens: {

0 commit comments

Comments
 (0)