From 07fcc11906e820c32c428e4d6a6389f07d7cc702 Mon Sep 17 00:00:00 2001 From: Juno Date: Thu, 25 Jun 2020 09:59:01 +0800 Subject: [PATCH 1/4] Divide border style --- src/corePlugins.js | 2 ++ src/plugins/divideStyle.js | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/plugins/divideStyle.js diff --git a/src/corePlugins.js b/src/corePlugins.js index f1211ba361e2..b0a696769747 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -3,6 +3,7 @@ import container from './plugins/container' import space from './plugins/space' import divideWidth from './plugins/divideWidth' import divideColor from './plugins/divideColor' +import divideStyle from './plugins/divideStyle' import accessibility from './plugins/accessibility' import appearance from './plugins/appearance' import backgroundAttachment from './plugins/backgroundAttachment' @@ -107,6 +108,7 @@ export default function({ corePlugins: corePluginConfig }) { space, divideWidth, divideColor, + divideStyle, divideOpacity, accessibility, appearance, diff --git a/src/plugins/divideStyle.js b/src/plugins/divideStyle.js new file mode 100644 index 000000000000..0a07068cd239 --- /dev/null +++ b/src/plugins/divideStyle.js @@ -0,0 +1,24 @@ +export default function() { + return function({ addUtilities, variants }) { + addUtilities( + { + '.divide-solid > :not(template) ~ :not(template)': { + 'border-style': 'solid', + }, + '.divide-dashed > :not(template) ~ :not(template)': { + 'border-style': 'dashed', + }, + '.divide-dotted > :not(template) ~ :not(template)': { + 'border-style': 'dotted', + }, + '.divide-double > :not(template) ~ :not(template)': { + 'border-style': 'double', + }, + '.divide-none > :not(template) ~ :not(template)': { + 'border-style': 'none', + }, + }, + variants('divideStyle') + ) + } +} \ No newline at end of file From 48d81ef33fc29468e4679267bf102fd649cbb063 Mon Sep 17 00:00:00 2001 From: Juno Date: Fri, 10 Jul 2020 12:33:27 +0800 Subject: [PATCH 2/4] Divide style test output --- __tests__/fixtures/tailwind-output.css | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index e16f646f935f..d4aba308c311 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -1686,6 +1686,26 @@ video { border-color: rgba(112, 36, 89, var(--divide-opacity)); } +.divide-solid > :not(template) ~ :not(template) { + border-style: solid; +} + +.divide-dashed > :not(template) ~ :not(template) { + border-style: dashed; +} + +.divide-dotted > :not(template) ~ :not(template) { + border-style: dotted; +} + +.divide-double > :not(template) ~ :not(template) { + border-style: double; +} + +.divide-none > :not(template) ~ :not(template) { + border-style: none; +} + .divide-opacity-0 > :not(template) ~ :not(template) { --divide-opacity: 0; } From b6e3cd3a9f62c3ae84e70b01f573ecfeff4a0460 Mon Sep 17 00:00:00 2001 From: Juno Date: Fri, 10 Jul 2020 12:49:14 +0800 Subject: [PATCH 3/4] more test outputs --- __tests__/fixtures/tailwind-output-ie11.css | 20 +++++++++++++++++++ .../fixtures/tailwind-output-important.css | 20 +++++++++++++++++++ .../tailwind-output-no-color-opacity.css | 20 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/__tests__/fixtures/tailwind-output-ie11.css b/__tests__/fixtures/tailwind-output-ie11.css index 0970edf9cbe6..69e0743c7156 100644 --- a/__tests__/fixtures/tailwind-output-ie11.css +++ b/__tests__/fixtures/tailwind-output-ie11.css @@ -1318,6 +1318,26 @@ video { border-color: #702459; } +.divide-solid > :not(template) ~ :not(template) { + border-style: solid; +} + +.divide-dashed > :not(template) ~ :not(template) { + border-style: dashed; +} + +.divide-dotted > :not(template) ~ :not(template) { + border-style: dotted; +} + +.divide-double > :not(template) ~ :not(template) { + border-style: double; +} + +.divide-none > :not(template) ~ :not(template) { + border-style: none; +} + .sr-only { position: absolute; width: 1px; diff --git a/__tests__/fixtures/tailwind-output-important.css b/__tests__/fixtures/tailwind-output-important.css index 779af9979a5e..1dae201c9ca0 100644 --- a/__tests__/fixtures/tailwind-output-important.css +++ b/__tests__/fixtures/tailwind-output-important.css @@ -1686,6 +1686,26 @@ video { border-color: rgba(112, 36, 89, var(--divide-opacity)) !important; } +.divide-solid > :not(template) ~ :not(template) { + border-style: solid !important; +} + +.divide-dashed > :not(template) ~ :not(template) { + border-style: dashed !important; +} + +.divide-dotted > :not(template) ~ :not(template) { + border-style: dotted !important; +} + +.divide-double > :not(template) ~ :not(template) { + border-style: double !important; +} + +.divide-none > :not(template) ~ :not(template) { + border-style: none !important; +} + .divide-opacity-0 > :not(template) ~ :not(template) { --divide-opacity: 0 !important; } diff --git a/__tests__/fixtures/tailwind-output-no-color-opacity.css b/__tests__/fixtures/tailwind-output-no-color-opacity.css index f7c17ca278f2..3e2283a7af8a 100644 --- a/__tests__/fixtures/tailwind-output-no-color-opacity.css +++ b/__tests__/fixtures/tailwind-output-no-color-opacity.css @@ -1502,6 +1502,26 @@ video { border-color: #702459; } +.divide-solid > :not(template) ~ :not(template) { + border-style: solid; +} + +.divide-dashed > :not(template) ~ :not(template) { + border-style: dashed; +} + +.divide-dotted > :not(template) ~ :not(template) { + border-style: dotted; +} + +.divide-double > :not(template) ~ :not(template) { + border-style: double; +} + +.divide-none > :not(template) ~ :not(template) { + border-style: none; +} + .sr-only { position: absolute; width: 1px; From 6308f2c7bb109998152976f38e2385e76a850742 Mon Sep 17 00:00:00 2001 From: Juno Date: Fri, 10 Jul 2020 12:56:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?Insert=20`=E2=8F=8E`=20=20prettier/prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/divideStyle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/divideStyle.js b/src/plugins/divideStyle.js index 0a07068cd239..d9ead99d43f5 100644 --- a/src/plugins/divideStyle.js +++ b/src/plugins/divideStyle.js @@ -21,4 +21,4 @@ export default function() { variants('divideStyle') ) } -} \ No newline at end of file +}