Skip to content

Commit 6740372

Browse files
committed
Revert "Add support for configuring default font-variation-settings for a font-family (#10515)"
This reverts commit 8bd2846.
1 parent 1668a54 commit 6740372

7 files changed

+286
-405
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Add logical properties support for inline direction ([#10166](https://github.com/tailwindlabs/tailwindcss/pull/10166))
1717
- Add `hyphens` utilities ([#10071](https://github.com/tailwindlabs/tailwindcss/pull/10071))
1818
- [Oxide] Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399))
19-
- Add support for configuring default `font-variation-settings` for a `font-family` ([#10034](https://github.com/tailwindlabs/tailwindcss/pull/10034), [#10515](https://github.com/tailwindlabs/tailwindcss/pull/10515))
2019

2120
### Fixed
2221

src/corePlugins.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1915,16 +1915,13 @@ export let corePlugins = {
19151915
font: (value) => {
19161916
let [families, options = {}] =
19171917
Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1918-
let { fontFeatureSettings, fontVariationSettings } = options
1918+
let { fontFeatureSettings } = options
19191919

19201920
return {
19211921
'font-family': Array.isArray(families) ? families.join(', ') : families,
19221922
...(fontFeatureSettings === undefined
19231923
? {}
19241924
: { 'font-feature-settings': fontFeatureSettings }),
1925-
...(fontVariationSettings === undefined
1926-
? {}
1927-
: { 'font-variation-settings': fontVariationSettings }),
19281925
}
19291926
},
19301927
},

src/css/preflight.css

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
3. Use a more readable tab size.
2424
4. Use the user's configured `sans` font-family by default.
2525
5. Use the user's configured `sans` font-feature-settings by default.
26-
6. Use the user's configured `sans` font-variation-settings by default.
2726
*/
2827

2928
html {
@@ -33,7 +32,6 @@ html {
3332
tab-size: 4; /* 3 */
3433
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 */
3534
font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
36-
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
3735
}
3836

3937
/*

tests/evaluateTailwindFunctions.test.js

-66
Original file line numberDiff line numberDiff line change
@@ -591,72 +591,6 @@ crosscheck(({ stable, oxide }) => {
591591
})
592592
})
593593

594-
test('font-family values are retrieved without font-variation-settings', () => {
595-
let input = css`
596-
.heading-1 {
597-
font-family: theme('fontFamily.sans');
598-
}
599-
.heading-2 {
600-
font-family: theme('fontFamily.serif');
601-
}
602-
.heading-3 {
603-
font-family: theme('fontFamily.mono');
604-
}
605-
`
606-
607-
let output = css`
608-
.heading-1 {
609-
font-family: Inter;
610-
}
611-
.heading-2 {
612-
font-family: Times, serif;
613-
}
614-
.heading-3 {
615-
font-family: Menlo, monospace;
616-
}
617-
`
618-
619-
return run(input, {
620-
theme: {
621-
fontFamily: {
622-
sans: ['Inter', { fontVariationSettings: '"opsz" 32' }],
623-
serif: [['Times', 'serif'], { fontVariationSettings: '"opsz" 32' }],
624-
mono: ['Menlo, monospace', { fontVariationSettings: '"opsz" 32' }],
625-
},
626-
},
627-
}).then((result) => {
628-
expect(result.css).toMatchCss(output)
629-
expect(result.warnings().length).toBe(0)
630-
})
631-
})
632-
633-
test('font-variation-settings values can be retrieved', () => {
634-
let input = css`
635-
.heading {
636-
font-family: theme('fontFamily.sans');
637-
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings');
638-
}
639-
`
640-
641-
let output = css`
642-
.heading {
643-
font-family: Inter;
644-
font-variation-settings: 'opsz' 32;
645-
}
646-
`
647-
648-
return run(input, {
649-
theme: {
650-
fontFamily: {
651-
sans: ['Inter', { fontVariationSettings: "'opsz' 32" }],
652-
},
653-
},
654-
}).then((result) => {
655-
expect(result.css).toMatchCss(output)
656-
expect(result.warnings().length).toBe(0)
657-
})
658-
})
659-
660594
test('font-family values are joined when an array', () => {
661595
let input = css`
662596
.element {

tests/plugins/fontFamily.test.js

-40
Original file line numberDiff line numberDiff line change
@@ -98,43 +98,3 @@ crosscheck(() => {
9898
})
9999
})
100100
})
101-
102-
test('font-variation-settings can be provided when families are defined as a string', () => {
103-
let config = {
104-
content: [{ raw: html`<div class="font-sans"></div>` }],
105-
theme: {
106-
fontFamily: {
107-
sans: ['Inter, sans-serif', { fontVariationSettings: '"opsz" 32' }],
108-
},
109-
},
110-
}
111-
112-
return run('@tailwind utilities', config).then((result) => {
113-
expect(result.css).toMatchCss(`
114-
.font-sans {
115-
font-family: Inter, sans-serif;
116-
font-variation-settings: "opsz" 32;
117-
}
118-
`)
119-
})
120-
})
121-
122-
test('font-variation-settings can be provided when families are defined as an array', () => {
123-
let config = {
124-
content: [{ raw: html`<div class="font-sans"></div>` }],
125-
theme: {
126-
fontFamily: {
127-
sans: [['Inter', 'sans-serif'], { fontVariationSettings: '"opsz" 32' }],
128-
},
129-
},
130-
}
131-
132-
return run('@tailwind utilities', config).then((result) => {
133-
expect(result.css).toMatchCss(`
134-
.font-sans {
135-
font-family: Inter, sans-serif;
136-
font-variation-settings: "opsz" 32;
137-
}
138-
`)
139-
})
140-
})

0 commit comments

Comments
 (0)