Skip to content

Commit d63a9f9

Browse files
committed
Add size-* shorthand (#12287)
* Add `size-*` shorthand Add plugin tests Adjust options wip * Update changelog
1 parent 80fe52a commit d63a9f9

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Extend default `opacity` scale to include all steps of 5 ([#11832](https://github.com/tailwindlabs/tailwindcss/pull/11832))
1616
- Update Preflight `html` styles to include shadow DOM `:host` pseudo-class ([#11200](https://github.com/tailwindlabs/tailwindcss/pull/11200))
1717
- Increase default values for `grid-rows-*` utilities from 1–6 to 1–12 ([#12180](https://github.com/tailwindlabs/tailwindcss/pull/12180))
18+
- Add `size-*` utilities ([#12287](https://github.com/tailwindlabs/tailwindcss/pull/12287))
1819

1920

2021
## [3.3.6] - 2023-12-04

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ export let corePlugins = {
779779

780780
aspectRatio: createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]]),
781781

782+
size: createUtilityPlugin('size', [['size', ['width', 'height']]]),
783+
782784
height: createUtilityPlugin('height', [['h', ['height']]]),
783785
maxHeight: createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]]),
784786
minHeight: createUtilityPlugin('minHeight', [['min-h', ['minHeight']]]),

stubs/config.full.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,40 @@ module.exports = {
975975
'3/4': '75%',
976976
full: '100%',
977977
}),
978+
size: ({ theme }) => ({
979+
auto: 'auto',
980+
...theme('spacing'),
981+
'1/2': '50%',
982+
'1/3': '33.333333%',
983+
'2/3': '66.666667%',
984+
'1/4': '25%',
985+
'2/4': '50%',
986+
'3/4': '75%',
987+
'1/5': '20%',
988+
'2/5': '40%',
989+
'3/5': '60%',
990+
'4/5': '80%',
991+
'1/6': '16.666667%',
992+
'2/6': '33.333333%',
993+
'3/6': '50%',
994+
'4/6': '66.666667%',
995+
'5/6': '83.333333%',
996+
'1/12': '8.333333%',
997+
'2/12': '16.666667%',
998+
'3/12': '25%',
999+
'4/12': '33.333333%',
1000+
'5/12': '41.666667%',
1001+
'6/12': '50%',
1002+
'7/12': '58.333333%',
1003+
'8/12': '66.666667%',
1004+
'9/12': '75%',
1005+
'10/12': '83.333333%',
1006+
'11/12': '91.666667%',
1007+
full: '100%',
1008+
min: 'min-content',
1009+
max: 'max-content',
1010+
fit: 'fit-content',
1011+
}),
9781012
width: ({ theme }) => ({
9791013
auto: 'auto',
9801014
...theme('spacing'),

0 commit comments

Comments
 (0)