Skip to content

Commit 1d2dd1a

Browse files
authored
Merge pull request #1965 from juno-w/master
Divide border style
2 parents 5b11f9c + 6308f2c commit 1d2dd1a

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed

__tests__/fixtures/tailwind-output-ie11.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,26 @@ video {
13171317
border-color: #702459;
13181318
}
13191319

1320+
.divide-solid > :not(template) ~ :not(template) {
1321+
border-style: solid;
1322+
}
1323+
1324+
.divide-dashed > :not(template) ~ :not(template) {
1325+
border-style: dashed;
1326+
}
1327+
1328+
.divide-dotted > :not(template) ~ :not(template) {
1329+
border-style: dotted;
1330+
}
1331+
1332+
.divide-double > :not(template) ~ :not(template) {
1333+
border-style: double;
1334+
}
1335+
1336+
.divide-none > :not(template) ~ :not(template) {
1337+
border-style: none;
1338+
}
1339+
13201340
.sr-only {
13211341
position: absolute;
13221342
width: 1px;

__tests__/fixtures/tailwind-output-important.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,26 @@ video {
16851685
border-color: rgba(112, 36, 89, var(--divide-opacity)) !important;
16861686
}
16871687

1688+
.divide-solid > :not(template) ~ :not(template) {
1689+
border-style: solid !important;
1690+
}
1691+
1692+
.divide-dashed > :not(template) ~ :not(template) {
1693+
border-style: dashed !important;
1694+
}
1695+
1696+
.divide-dotted > :not(template) ~ :not(template) {
1697+
border-style: dotted !important;
1698+
}
1699+
1700+
.divide-double > :not(template) ~ :not(template) {
1701+
border-style: double !important;
1702+
}
1703+
1704+
.divide-none > :not(template) ~ :not(template) {
1705+
border-style: none !important;
1706+
}
1707+
16881708
.divide-opacity-0 > :not(template) ~ :not(template) {
16891709
--divide-opacity: 0 !important;
16901710
}

__tests__/fixtures/tailwind-output-no-color-opacity.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,26 @@ video {
15011501
border-color: #702459;
15021502
}
15031503

1504+
.divide-solid > :not(template) ~ :not(template) {
1505+
border-style: solid;
1506+
}
1507+
1508+
.divide-dashed > :not(template) ~ :not(template) {
1509+
border-style: dashed;
1510+
}
1511+
1512+
.divide-dotted > :not(template) ~ :not(template) {
1513+
border-style: dotted;
1514+
}
1515+
1516+
.divide-double > :not(template) ~ :not(template) {
1517+
border-style: double;
1518+
}
1519+
1520+
.divide-none > :not(template) ~ :not(template) {
1521+
border-style: none;
1522+
}
1523+
15041524
.sr-only {
15051525
position: absolute;
15061526
width: 1px;

__tests__/fixtures/tailwind-output.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,26 @@ video {
16851685
border-color: rgba(112, 36, 89, var(--divide-opacity));
16861686
}
16871687

1688+
.divide-solid > :not(template) ~ :not(template) {
1689+
border-style: solid;
1690+
}
1691+
1692+
.divide-dashed > :not(template) ~ :not(template) {
1693+
border-style: dashed;
1694+
}
1695+
1696+
.divide-dotted > :not(template) ~ :not(template) {
1697+
border-style: dotted;
1698+
}
1699+
1700+
.divide-double > :not(template) ~ :not(template) {
1701+
border-style: double;
1702+
}
1703+
1704+
.divide-none > :not(template) ~ :not(template) {
1705+
border-style: none;
1706+
}
1707+
16881708
.divide-opacity-0 > :not(template) ~ :not(template) {
16891709
--divide-opacity: 0;
16901710
}

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import container from './plugins/container'
33
import space from './plugins/space'
44
import divideWidth from './plugins/divideWidth'
55
import divideColor from './plugins/divideColor'
6+
import divideStyle from './plugins/divideStyle'
67
import accessibility from './plugins/accessibility'
78
import appearance from './plugins/appearance'
89
import backgroundAttachment from './plugins/backgroundAttachment'
@@ -110,6 +111,7 @@ export default function({ corePlugins: corePluginConfig }) {
110111
space,
111112
divideWidth,
112113
divideColor,
114+
divideStyle,
113115
divideOpacity,
114116
accessibility,
115117
appearance,

src/plugins/divideStyle.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export default function() {
2+
return function({ addUtilities, variants }) {
3+
addUtilities(
4+
{
5+
'.divide-solid > :not(template) ~ :not(template)': {
6+
'border-style': 'solid',
7+
},
8+
'.divide-dashed > :not(template) ~ :not(template)': {
9+
'border-style': 'dashed',
10+
},
11+
'.divide-dotted > :not(template) ~ :not(template)': {
12+
'border-style': 'dotted',
13+
},
14+
'.divide-double > :not(template) ~ :not(template)': {
15+
'border-style': 'double',
16+
},
17+
'.divide-none > :not(template) ~ :not(template)': {
18+
'border-style': 'none',
19+
},
20+
},
21+
variants('divideStyle')
22+
)
23+
}
24+
}

0 commit comments

Comments
 (0)