Skip to content

Commit 5189d25

Browse files
committed
Revert "Add line-height modifier support to font-size utilities"
1 parent c6ae5ab commit 5189d25

File tree

5 files changed

+3
-112
lines changed

5 files changed

+3
-112
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Add `line-height` modifier support to `font-size` utilities ([#9875](https://github.com/tailwindlabs/tailwindcss/pull/9875))
1312
- Add standalone CLI build for 64-bit Windows on ARM (`node16-win-arm64`) ([#10001](https://github.com/tailwindlabs/tailwindcss/pull/10001))
1413
- [Oxide] Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399))
1514

src/corePlugins.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1861,16 +1861,9 @@ export let corePlugins = {
18611861
fontSize: ({ matchUtilities, theme }) => {
18621862
matchUtilities(
18631863
{
1864-
text: (value, { modifier }) => {
1864+
text: (value) => {
18651865
let [fontSize, options] = Array.isArray(value) ? value : [value]
18661866

1867-
if (modifier) {
1868-
return {
1869-
'font-size': fontSize,
1870-
'line-height': modifier,
1871-
}
1872-
}
1873-
18741867
let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
18751868
? options
18761869
: { lineHeight: options }
@@ -1885,7 +1878,6 @@ export let corePlugins = {
18851878
},
18861879
{
18871880
values: theme('fontSize'),
1888-
modifiers: theme('lineHeight'),
18891881
type: ['absolute-size', 'relative-size', 'length', 'percentage'],
18901882
}
18911883
)

tests/getClassList.test.js

-22
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ crosscheck(() => {
8888
let classes = context.getClassList({ includeMetadata: true })
8989

9090
expect(classes).not.toContain('bg-red-500')
91-
expect(classes).not.toContain('text-2xl')
9291

9392
expect(classes).toContainEqual([
9493
'bg-red-500',
@@ -112,27 +111,6 @@ crosscheck(() => {
112111
],
113112
},
114113
])
115-
expect(classes).toContainEqual([
116-
'text-2xl',
117-
{
118-
modifiers: [
119-
'3',
120-
'4',
121-
'5',
122-
'6',
123-
'7',
124-
'8',
125-
'9',
126-
'10',
127-
'none',
128-
'tight',
129-
'snug',
130-
'normal',
131-
'relaxed',
132-
'loose',
133-
],
134-
},
135-
])
136114
})
137115

138116
it('should generate plugin-defined utilities with modifier data when requested', () => {

tests/match-utilities.test.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ crosscheck(() => {
66
content: [
77
{
88
raw: html`<div
9-
class="test test/foo test-1/foo test-2/foo test/[foo] test-1/[foo] test-[8]/[9]"
10-
></div> `,
9+
class="test test/foo test-1/foo test-2/foo test/[foo] test-1/[foo]"
10+
></div>`,
1111
},
1212
],
1313
corePlugins: { preflight: false },
@@ -27,7 +27,6 @@ crosscheck(() => {
2727
'1': 'one',
2828
'2': 'two',
2929
'1/foo': 'onefoo',
30-
'[8]/[9]': 'eightnine',
3130
},
3231
modifiers: 'any',
3332
}
@@ -55,9 +54,6 @@ crosscheck(() => {
5554
.test-2\/foo {
5655
color: two_foo;
5756
}
58-
.test-\[8\]\/\[9\] {
59-
color: eightnine_null;
60-
}
6157
.test\/\[foo\] {
6258
color: default_[foo];
6359
}

tests/plugins/fontSize.test.js

-74
Original file line numberDiff line numberDiff line change
@@ -120,78 +120,4 @@ crosscheck(() => {
120120
`)
121121
})
122122
})
123-
124-
test('font-size utilities can include a line-height modifier', () => {
125-
let config = {
126-
content: [
127-
{
128-
raw: html`<div class="text-sm md:text-base">
129-
<div class="text-sm/6 md:text-base/7"></div>
130-
<div class="text-sm/[21px] md:text-base/[33px]"></div>
131-
<div class="text-[13px]/6 md:text-[19px]/8"></div>
132-
<div class="text-[17px]/[23px] md:text-[21px]/[29px]"></div>
133-
<div class="text-sm/999 md:text-base/000"></div>
134-
</div>`,
135-
},
136-
],
137-
theme: {
138-
fontSize: {
139-
sm: ['12px', '20px'],
140-
base: ['16px', '24px'],
141-
},
142-
lineHeight: {
143-
6: '24px',
144-
7: '28px',
145-
8: '32px',
146-
},
147-
},
148-
}
149-
150-
return run('@tailwind utilities', config).then((result) => {
151-
expect(result.css).toMatchCss(css`
152-
.text-\[13px\]\/6 {
153-
font-size: 13px;
154-
line-height: 24px;
155-
}
156-
.text-\[17px\]\/\[23px\] {
157-
font-size: 17px;
158-
line-height: 23px;
159-
}
160-
.text-sm {
161-
font-size: 12px;
162-
line-height: 20px;
163-
}
164-
.text-sm\/6 {
165-
font-size: 12px;
166-
line-height: 24px;
167-
}
168-
.text-sm\/\[21px\] {
169-
font-size: 12px;
170-
line-height: 21px;
171-
}
172-
@media (min-width: 768px) {
173-
.md\:text-\[19px\]\/8 {
174-
font-size: 19px;
175-
line-height: 32px;
176-
}
177-
.md\:text-\[21px\]\/\[29px\] {
178-
font-size: 21px;
179-
line-height: 29px;
180-
}
181-
.md\:text-base {
182-
font-size: 16px;
183-
line-height: 24px;
184-
}
185-
.md\:text-base\/7 {
186-
font-size: 16px;
187-
line-height: 28px;
188-
}
189-
.md\:text-base\/\[33px\] {
190-
font-size: 16px;
191-
line-height: 33px;
192-
}
193-
}
194-
`)
195-
})
196-
})
197123
})

0 commit comments

Comments
 (0)