Skip to content

Commit 48d0621

Browse files
alberto-bottariniadamwathan
authored andcommitted
add boxSizing classes
1 parent 06352a8 commit 48d0621

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

__tests__/fixtures/tailwind-output-important.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6817,6 +6817,14 @@ video {
68176817
box-shadow: none !important;
68186818
}
68196819

6820+
.box-sizing-border {
6821+
box-sizing: border !important;
6822+
}
6823+
6824+
.box-sizing-content {
6825+
box-sizing: content !important;
6826+
}
6827+
68206828
.fill-current {
68216829
fill: currentColor !important;
68226830
}
@@ -16131,6 +16139,14 @@ video {
1613116139
box-shadow: none !important;
1613216140
}
1613316141

16142+
.sm\:box-sizing-border {
16143+
box-sizing: border !important;
16144+
}
16145+
16146+
.sm\:box-sizing-content {
16147+
box-sizing: content !important;
16148+
}
16149+
1613416150
.sm\:fill-current {
1613516151
fill: currentColor !important;
1613616152
}
@@ -25446,6 +25462,14 @@ video {
2544625462
box-shadow: none !important;
2544725463
}
2544825464

25465+
.md\:box-sizing-border {
25466+
box-sizing: border !important;
25467+
}
25468+
25469+
.md\:box-sizing-content {
25470+
box-sizing: content !important;
25471+
}
25472+
2544925473
.md\:fill-current {
2545025474
fill: currentColor !important;
2545125475
}
@@ -34761,6 +34785,14 @@ video {
3476134785
box-shadow: none !important;
3476234786
}
3476334787

34788+
.lg\:box-sizing-border {
34789+
box-sizing: border !important;
34790+
}
34791+
34792+
.lg\:box-sizing-content {
34793+
box-sizing: content !important;
34794+
}
34795+
3476434796
.lg\:fill-current {
3476534797
fill: currentColor !important;
3476634798
}
@@ -44076,6 +44108,14 @@ video {
4407644108
box-shadow: none !important;
4407744109
}
4407844110

44111+
.xl\:box-sizing-border {
44112+
box-sizing: border !important;
44113+
}
44114+
44115+
.xl\:box-sizing-content {
44116+
box-sizing: content !important;
44117+
}
44118+
4407944119
.xl\:fill-current {
4408044120
fill: currentColor !important;
4408144121
}

__tests__/fixtures/tailwind-output.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6817,6 +6817,14 @@ video {
68176817
box-shadow: none;
68186818
}
68196819

6820+
.box-sizing-border {
6821+
box-sizing: border;
6822+
}
6823+
6824+
.box-sizing-content {
6825+
box-sizing: content;
6826+
}
6827+
68206828
.fill-current {
68216829
fill: currentColor;
68226830
}
@@ -16131,6 +16139,14 @@ video {
1613116139
box-shadow: none;
1613216140
}
1613316141

16142+
.sm\:box-sizing-border {
16143+
box-sizing: border;
16144+
}
16145+
16146+
.sm\:box-sizing-content {
16147+
box-sizing: content;
16148+
}
16149+
1613416150
.sm\:fill-current {
1613516151
fill: currentColor;
1613616152
}
@@ -25446,6 +25462,14 @@ video {
2544625462
box-shadow: none;
2544725463
}
2544825464

25465+
.md\:box-sizing-border {
25466+
box-sizing: border;
25467+
}
25468+
25469+
.md\:box-sizing-content {
25470+
box-sizing: content;
25471+
}
25472+
2544925473
.md\:fill-current {
2545025474
fill: currentColor;
2545125475
}
@@ -34761,6 +34785,14 @@ video {
3476134785
box-shadow: none;
3476234786
}
3476334787

34788+
.lg\:box-sizing-border {
34789+
box-sizing: border;
34790+
}
34791+
34792+
.lg\:box-sizing-content {
34793+
box-sizing: content;
34794+
}
34795+
3476434796
.lg\:fill-current {
3476534797
fill: currentColor;
3476634798
}
@@ -44076,6 +44108,14 @@ video {
4407644108
box-shadow: none;
4407744109
}
4407844110

44111+
.xl\:box-sizing-border {
44112+
box-sizing: border;
44113+
}
44114+
44115+
.xl\:box-sizing-content {
44116+
box-sizing: content;
44117+
}
44118+
4407944119
.xl\:fill-current {
4408044120
fill: currentColor;
4408144121
}

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import position from './plugins/position'
4848
import inset from './plugins/inset'
4949
import resize from './plugins/resize'
5050
import boxShadow from './plugins/boxShadow'
51+
import boxSizing from './plugins/boxSizing'
5152
import fill from './plugins/fill'
5253
import stroke from './plugins/stroke'
5354
import tableLayout from './plugins/tableLayout'
@@ -126,6 +127,7 @@ export default function({ corePlugins: corePluginConfig }) {
126127
inset,
127128
resize,
128129
boxShadow,
130+
boxSizing,
129131
fill,
130132
stroke,
131133
tableLayout,

src/plugins/boxSizing.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function() {
2+
return function({ addUtilities, variants }) {
3+
addUtilities(
4+
{
5+
'.box-sizing-border': { 'box-sizing': 'border' },
6+
'.box-sizing-content': { 'box-sizing': 'content' },
7+
},
8+
variants('boxSizing')
9+
)
10+
}
11+
}

stubs/defaultConfig.stub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ module.exports = {
465465
borderStyle: ['responsive'],
466466
borderWidth: ['responsive'],
467467
boxShadow: ['responsive', 'hover', 'focus'],
468+
boxSizing: ['responsive'],
468469
cursor: ['responsive'],
469470
display: ['responsive'],
470471
fill: ['responsive'],

0 commit comments

Comments
 (0)