Skip to content

Commit

Permalink
Move default border color back to preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Jan 7, 2022
1 parent c2ee08c commit f1f6ea2
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 50 deletions.
8 changes: 1 addition & 7 deletions src/corePlugins.js
Expand Up @@ -1179,13 +1179,7 @@ export let corePlugins = {
})
},

borderColor: ({ addDefaults, matchUtilities, theme, corePlugins }) => {
let value = theme('borderColor.DEFAULT', 'currentColor')

addDefaults('border-width', {
'border-color': toColorValue(value),
})

borderColor: ({ matchUtilities, theme, corePlugins }) => {
matchUtilities(
{
border: (value) => {
Expand Down
2 changes: 1 addition & 1 deletion src/css/preflight.css
Expand Up @@ -9,7 +9,7 @@
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */
border-color: currentColor; /* 2 */
border-color: theme('borderColor.DEFAULT', 'currentColor'); /* 2 */
}

::before,
Expand Down
6 changes: 0 additions & 6 deletions tests/apply.test.js
Expand Up @@ -640,12 +640,6 @@ it('rules with vendor prefixes are still separate when optimizing defaults rules

return run(input, config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
[type='range']::-moz-range-thumb {
border-color: #e5e7eb;
}
.border {
border-color: #e5e7eb;
}
input[type='range']::-moz-range-thumb {
border-width: 1px;
}
Expand Down
1 change: 0 additions & 1 deletion tests/basic-usage.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/collapse-adjacent-rules.test.css
Expand Up @@ -21,7 +21,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
12 changes: 0 additions & 12 deletions tests/experimental.test.js
Expand Up @@ -122,10 +122,6 @@ test('experimental universal selector improvements (child selectors: divide-y)',

return run(input, config).then((result) => {
expect(result.css).toMatchCss(css`
.divide-y > * {
border-color: #e5e7eb;
}
.resize {
resize: both;
}
Expand Down Expand Up @@ -153,10 +149,6 @@ test('experimental universal selector improvements (hover:divide-y)', () => {

return run(input, config).then((result) => {
expect(result.css).toMatchCss(css`
.hover\:divide-y > * {
border-color: #e5e7eb;
}
.resize {
resize: both;
}
Expand Down Expand Up @@ -185,10 +177,6 @@ test('experimental universal selector improvements (#app important)', () => {

return run(input, config).then((result) => {
expect(result.css).toMatchCss(css`
.divide-y > * {
border-color: #e5e7eb;
}
.shadow {
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
Expand Down
1 change: 0 additions & 1 deletion tests/import-syntax.test.css
Expand Up @@ -15,7 +15,6 @@ h1 {
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/important-boolean.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/important-modifier-prefix.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/important-modifier.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/important-selector.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/kitchen-sink.test.css
Expand Up @@ -150,7 +150,6 @@ div {
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
5 changes: 0 additions & 5 deletions tests/plugins/divide.test.js
Expand Up @@ -22,7 +22,6 @@ it('should add the divide styles for divide-y and a default border color', () =>
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down Expand Up @@ -87,7 +86,6 @@ it('should add the divide styles for divide-x and a default border color', () =>
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down Expand Up @@ -152,7 +150,6 @@ it('should add the divide styles for divide-y-reverse and a default border color
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down Expand Up @@ -215,7 +212,6 @@ it('should add the divide styles for divide-x-reverse and a default border color
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down Expand Up @@ -278,7 +274,6 @@ it('should only inject the base styles once if we use divide and border at the s
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/prefix.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
6 changes: 0 additions & 6 deletions tests/resolve-defaults-at-rules.test.js
Expand Up @@ -507,12 +507,6 @@ test('with borders', async () => {

return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
*,
::before,
::after {
border-color: #e5e7eb;
}
/* --- */
.border {
border-width: 1px;
Expand Down
3 changes: 0 additions & 3 deletions tests/util/defaults.js
Expand Up @@ -2,12 +2,10 @@ import { css } from './strings'

/**
* @param {object} param0
* @param {string} [param0.defaultBorderColor]
* @param {string} [param0.defaultRingColor]
* @returns {string}
*/
export function defaults({
defaultBorderColor = `#e5e7eb`,
defaultRingColor = `rgb(59 130 246 / 0.5)`,
} = {}) {
return css`
Expand All @@ -25,7 +23,6 @@ export function defaults({
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: ${defaultBorderColor};
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down
1 change: 0 additions & 1 deletion tests/variants.test.css
Expand Up @@ -12,7 +12,6 @@
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
Expand Down

0 comments on commit f1f6ea2

Please sign in to comment.