Skip to content

Commit 89461f9

Browse files
authored
Merge pull request #2145 from tailwindlabs/extended-font-size-scale
Add experimental extendedFontSizeScale
2 parents cfb9996 + aa81067 commit 89461f9

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed

__tests__/fixtures/tailwind-output-flagged.css

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7967,6 +7967,21 @@ video {
79677967
line-height: 1;
79687968
}
79697969

7970+
.text-7xl {
7971+
font-size: 5rem;
7972+
line-height: 1;
7973+
}
7974+
7975+
.text-8xl {
7976+
font-size: 6rem;
7977+
line-height: 1;
7978+
}
7979+
7980+
.text-9xl {
7981+
font-size: 8rem;
7982+
line-height: 1;
7983+
}
7984+
79707985
.leading-3 {
79717986
line-height: .75rem;
79727987
}
@@ -33029,6 +33044,21 @@ video {
3302933044
line-height: 1;
3303033045
}
3303133046

33047+
.sm\:text-7xl {
33048+
font-size: 5rem;
33049+
line-height: 1;
33050+
}
33051+
33052+
.sm\:text-8xl {
33053+
font-size: 6rem;
33054+
line-height: 1;
33055+
}
33056+
33057+
.sm\:text-9xl {
33058+
font-size: 8rem;
33059+
line-height: 1;
33060+
}
33061+
3303233062
.sm\:leading-3 {
3303333063
line-height: .75rem;
3303433064
}
@@ -58061,6 +58091,21 @@ video {
5806158091
line-height: 1;
5806258092
}
5806358093

58094+
.md\:text-7xl {
58095+
font-size: 5rem;
58096+
line-height: 1;
58097+
}
58098+
58099+
.md\:text-8xl {
58100+
font-size: 6rem;
58101+
line-height: 1;
58102+
}
58103+
58104+
.md\:text-9xl {
58105+
font-size: 8rem;
58106+
line-height: 1;
58107+
}
58108+
5806458109
.md\:leading-3 {
5806558110
line-height: .75rem;
5806658111
}
@@ -83093,6 +83138,21 @@ video {
8309383138
line-height: 1;
8309483139
}
8309583140

83141+
.lg\:text-7xl {
83142+
font-size: 5rem;
83143+
line-height: 1;
83144+
}
83145+
83146+
.lg\:text-8xl {
83147+
font-size: 6rem;
83148+
line-height: 1;
83149+
}
83150+
83151+
.lg\:text-9xl {
83152+
font-size: 8rem;
83153+
line-height: 1;
83154+
}
83155+
8309683156
.lg\:leading-3 {
8309783157
line-height: .75rem;
8309883158
}
@@ -108125,6 +108185,21 @@ video {
108125108185
line-height: 1;
108126108186
}
108127108187

108188+
.xl\:text-7xl {
108189+
font-size: 5rem;
108190+
line-height: 1;
108191+
}
108192+
108193+
.xl\:text-8xl {
108194+
font-size: 6rem;
108195+
line-height: 1;
108196+
}
108197+
108198+
.xl\:text-9xl {
108199+
font-size: 8rem;
108200+
line-height: 1;
108201+
}
108202+
108128108203
.xl\:leading-3 {
108129108204
line-height: .75rem;
108130108205
}

src/featureFlags.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import chalk from 'chalk'
33

44
const featureFlags = {
55
future: ['removeDeprecatedGapUtilities'],
6-
experimental: ['uniformColorPalette', 'extendedSpacingScale', 'defaultLineHeights'],
6+
experimental: [
7+
'uniformColorPalette',
8+
'extendedSpacingScale',
9+
'defaultLineHeights',
10+
'extendedFontSizeScale',
11+
],
712
}
813

914
export function flagEnabled(config, flag) {

src/flagged/extendedFontSizeScale.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
theme: {
3+
extend: {
4+
fontSize: {
5+
'7xl': ['5rem', { lineHeight: '1' }],
6+
'8xl': ['6rem', { lineHeight: '1' }],
7+
'9xl': ['8rem', { lineHeight: '1' }],
8+
},
9+
},
10+
},
11+
}

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { flagEnabled } from './featureFlags'
1616
import uniformColorPalette from './flagged/uniformColorPalette.js'
1717
import extendedSpacingScale from './flagged/extendedSpacingScale.js'
1818
import defaultLineHeights from './flagged/defaultLineHeights.js'
19+
import extendedFontSizeScale from './flagged/extendedFontSizeScale.js'
1920

2021
function getDefaultConfigs(config) {
2122
const configs = [defaultConfig]
@@ -32,6 +33,10 @@ function getDefaultConfigs(config) {
3233
configs.unshift(defaultLineHeights)
3334
}
3435

36+
if (flagEnabled(config, 'extendedFontSizeScale')) {
37+
configs.unshift(extendedFontSizeScale)
38+
}
39+
3540
return configs
3641
}
3742

0 commit comments

Comments
 (0)