Skip to content

Commit 30a4e51

Browse files
authored
Rename hairline and thin font weights to thin and extralight (#2333)
* Add standardFontWeights flag for update thin/extralight font weight names * Update changelog
1 parent 45cf3c5 commit 30a4e51

File tree

5 files changed

+52
-31
lines changed

5 files changed

+52
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
- Fix [issue](https://github.com/tailwindlabs/tailwindcss/issues/2258) where inserting extra PurgeCSS control comments could break integrated PurgeCSS support
11+
- Rename `font-hairline` and `font-thin` to `font-thin` and `font-extralight` behind `standardFontWeights` flag ([#2333](https://github.com/tailwindlabs/tailwindcss/pull/2333))
1112

1213
## [1.8.3] - 2020-09-05
1314

__tests__/fixtures/tailwind-output-flagged.css

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20817,11 +20817,11 @@ video {
2081720817
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
2081820818
}
2081920819

20820-
.font-hairline {
20820+
.font-thin {
2082120821
font-weight: 100;
2082220822
}
2082320823

20824-
.font-thin {
20824+
.font-extralight {
2082520825
font-weight: 200;
2082620826
}
2082720827

@@ -20853,11 +20853,11 @@ video {
2085320853
font-weight: 900;
2085420854
}
2085520855

20856-
.hover\:font-hairline:hover {
20856+
.hover\:font-thin:hover {
2085720857
font-weight: 100;
2085820858
}
2085920859

20860-
.hover\:font-thin:hover {
20860+
.hover\:font-extralight:hover {
2086120861
font-weight: 200;
2086220862
}
2086320863

@@ -20889,11 +20889,11 @@ video {
2088920889
font-weight: 900;
2089020890
}
2089120891

20892-
.focus\:font-hairline:focus {
20892+
.focus\:font-thin:focus {
2089320893
font-weight: 100;
2089420894
}
2089520895

20896-
.focus\:font-thin:focus {
20896+
.focus\:font-extralight:focus {
2089720897
font-weight: 200;
2089820898
}
2089920899

@@ -62315,11 +62315,11 @@ video {
6231562315
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
6231662316
}
6231762317

62318-
.sm\:font-hairline {
62318+
.sm\:font-thin {
6231962319
font-weight: 100;
6232062320
}
6232162321

62322-
.sm\:font-thin {
62322+
.sm\:font-extralight {
6232362323
font-weight: 200;
6232462324
}
6232562325

@@ -62351,11 +62351,11 @@ video {
6235162351
font-weight: 900;
6235262352
}
6235362353

62354-
.sm\:hover\:font-hairline:hover {
62354+
.sm\:hover\:font-thin:hover {
6235562355
font-weight: 100;
6235662356
}
6235762357

62358-
.sm\:hover\:font-thin:hover {
62358+
.sm\:hover\:font-extralight:hover {
6235962359
font-weight: 200;
6236062360
}
6236162361

@@ -62387,11 +62387,11 @@ video {
6238762387
font-weight: 900;
6238862388
}
6238962389

62390-
.sm\:focus\:font-hairline:focus {
62390+
.sm\:focus\:font-thin:focus {
6239162391
font-weight: 100;
6239262392
}
6239362393

62394-
.sm\:focus\:font-thin:focus {
62394+
.sm\:focus\:font-extralight:focus {
6239562395
font-weight: 200;
6239662396
}
6239762397

@@ -103783,11 +103783,11 @@ video {
103783103783
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
103784103784
}
103785103785

103786-
.md\:font-hairline {
103786+
.md\:font-thin {
103787103787
font-weight: 100;
103788103788
}
103789103789

103790-
.md\:font-thin {
103790+
.md\:font-extralight {
103791103791
font-weight: 200;
103792103792
}
103793103793

@@ -103819,11 +103819,11 @@ video {
103819103819
font-weight: 900;
103820103820
}
103821103821

103822-
.md\:hover\:font-hairline:hover {
103822+
.md\:hover\:font-thin:hover {
103823103823
font-weight: 100;
103824103824
}
103825103825

103826-
.md\:hover\:font-thin:hover {
103826+
.md\:hover\:font-extralight:hover {
103827103827
font-weight: 200;
103828103828
}
103829103829

@@ -103855,11 +103855,11 @@ video {
103855103855
font-weight: 900;
103856103856
}
103857103857

103858-
.md\:focus\:font-hairline:focus {
103858+
.md\:focus\:font-thin:focus {
103859103859
font-weight: 100;
103860103860
}
103861103861

103862-
.md\:focus\:font-thin:focus {
103862+
.md\:focus\:font-extralight:focus {
103863103863
font-weight: 200;
103864103864
}
103865103865

@@ -145251,11 +145251,11 @@ video {
145251145251
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
145252145252
}
145253145253

145254-
.lg\:font-hairline {
145254+
.lg\:font-thin {
145255145255
font-weight: 100;
145256145256
}
145257145257

145258-
.lg\:font-thin {
145258+
.lg\:font-extralight {
145259145259
font-weight: 200;
145260145260
}
145261145261

@@ -145287,11 +145287,11 @@ video {
145287145287
font-weight: 900;
145288145288
}
145289145289

145290-
.lg\:hover\:font-hairline:hover {
145290+
.lg\:hover\:font-thin:hover {
145291145291
font-weight: 100;
145292145292
}
145293145293

145294-
.lg\:hover\:font-thin:hover {
145294+
.lg\:hover\:font-extralight:hover {
145295145295
font-weight: 200;
145296145296
}
145297145297

@@ -145323,11 +145323,11 @@ video {
145323145323
font-weight: 900;
145324145324
}
145325145325

145326-
.lg\:focus\:font-hairline:focus {
145326+
.lg\:focus\:font-thin:focus {
145327145327
font-weight: 100;
145328145328
}
145329145329

145330-
.lg\:focus\:font-thin:focus {
145330+
.lg\:focus\:font-extralight:focus {
145331145331
font-weight: 200;
145332145332
}
145333145333

@@ -186719,11 +186719,11 @@ video {
186719186719
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
186720186720
}
186721186721

186722-
.xl\:font-hairline {
186722+
.xl\:font-thin {
186723186723
font-weight: 100;
186724186724
}
186725186725

186726-
.xl\:font-thin {
186726+
.xl\:font-extralight {
186727186727
font-weight: 200;
186728186728
}
186729186729

@@ -186755,11 +186755,11 @@ video {
186755186755
font-weight: 900;
186756186756
}
186757186757

186758-
.xl\:hover\:font-hairline:hover {
186758+
.xl\:hover\:font-thin:hover {
186759186759
font-weight: 100;
186760186760
}
186761186761

186762-
.xl\:hover\:font-thin:hover {
186762+
.xl\:hover\:font-extralight:hover {
186763186763
font-weight: 200;
186764186764
}
186765186765

@@ -186791,11 +186791,11 @@ video {
186791186791
font-weight: 900;
186792186792
}
186793186793

186794-
.xl\:focus\:font-hairline:focus {
186794+
.xl\:focus\:font-thin:focus {
186795186795
font-weight: 100;
186796186796
}
186797186797

186798-
.xl\:focus\:font-thin:focus {
186798+
.xl\:focus\:font-extralight:focus {
186799186799
font-weight: 200;
186800186800
}
186801186801

src/featureFlags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import chalk from 'chalk'
33
import log from './util/log'
44

55
const featureFlags = {
6-
future: ['removeDeprecatedGapUtilities', 'purgeLayersByDefault'],
6+
future: ['removeDeprecatedGapUtilities', 'purgeLayersByDefault', 'standardFontWeights'],
77
experimental: [
88
'uniformColorPalette',
99
'extendedSpacingScale',

src/flagged/standardFontWeights.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default {
2+
theme: {
3+
fontWeight: {
4+
thin: '100',
5+
extralight: '200',
6+
light: '300',
7+
normal: '400',
8+
medium: '500',
9+
semibold: '600',
10+
bold: '700',
11+
extrabold: '800',
12+
black: '900',
13+
},
14+
},
15+
}

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import extendedSpacingScale from './flagged/extendedSpacingScale.js'
1818
import defaultLineHeights from './flagged/defaultLineHeights.js'
1919
import extendedFontSizeScale from './flagged/extendedFontSizeScale.js'
2020
import darkModeVariant from './flagged/darkModeVariant.js'
21+
import standardFontWeights from './flagged/standardFontWeights'
2122

2223
function getAllConfigs(config) {
2324
const configs = [defaultConfig]
@@ -38,6 +39,10 @@ function getAllConfigs(config) {
3839
configs.unshift(extendedFontSizeScale)
3940
}
4041

42+
if (flagEnabled(config, 'standardFontWeights')) {
43+
configs.unshift(standardFontWeights)
44+
}
45+
4146
if (flagEnabled(config, 'darkModeVariant')) {
4247
configs.unshift(darkModeVariant)
4348
if (Array.isArray(config.plugins)) {

0 commit comments

Comments
 (0)