Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit 95dc464

Browse files
committed
Remove checked variant (fix #8)
1 parent aadbde7 commit 95dc464

File tree

4 files changed

+12
-46
lines changed

4 files changed

+12
-46
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [5.0.0] - 2020-08-04
9+
10+
### Removed
11+
- Removed the `checked` variant since it is built into Tailwind as of v1.5
12+
813
## [4.0.0] - 2020-05-09
914

1015
### Removed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
},
2626
},
2727
variants: {
28-
backgroundColor: ['checked', 'group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover'],
28+
backgroundColor: ['group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover'],
2929
},
3030
plugins: [
3131
require('tailwindcss-interaction-variants'),
@@ -40,10 +40,6 @@ The above configuration would generate the following CSS:
4040
background-color: black;
4141
}
4242

43-
.checked\:bg-black:checked {
44-
background-color: black;
45-
}
46-
4743
.group:focus-within .group-focus-within\:bg-black {
4844
background-color: black;
4945
}

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module.exports = plugin(function({ addVariant, config, e, postcss }) {
3737
};
3838
};
3939

40-
addVariant('checked', pseudoClassVariant('checked'));
4140
addVariant('group-focus-within', groupPseudoClassVariant('focus-within'));
4241
addVariant('group-active', groupPseudoClassVariant('active'));
4342
addVariant('group-visited', groupPseudoClassVariant('visited'));

test.js

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ test('the plugin doesn’t do anything if the variants aren’t used', () => {
4848
});
4949
});
5050

51-
test('the checked variant is working', () => {
52-
return generatePluginCss(['checked']).then(css => {
53-
expect(css).toMatchCss(`
54-
.w-1\\/2 {
55-
width: 50%;
56-
}
57-
.checked\\:w-1\\/2:checked {
58-
width: 50%;
59-
}
60-
`);
61-
});
62-
});
63-
6451
test('the hocus variant is working', () => {
6552
return generatePluginCss(['hocus']).then(css => {
6653
expect(css).toMatchCss(`
@@ -118,14 +105,11 @@ test('the no-hover variant is working', () => {
118105
});
119106

120107
test('all the variants are working', () => {
121-
return generatePluginCss(['checked', 'group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover']).then(css => {
108+
return generatePluginCss(['group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover']).then(css => {
122109
expect(css).toMatchCss(`
123110
.w-1\\/2 {
124111
width: 50%;
125112
}
126-
.checked\\:w-1\\/2:checked {
127-
width: 50%;
128-
}
129113
.group:focus-within .group-focus-within\\:w-1\\/2 {
130114
width: 50%;
131115
}
@@ -159,14 +143,11 @@ test('all the variants are working', () => {
159143
});
160144

161145
test('all variants can be chained with the responsive variant', () => {
162-
return generatePluginCss(['checked', 'group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover', 'responsive']).then(css => {
146+
return generatePluginCss(['group-focus-within', 'group-active', 'group-visited', 'group-disabled', 'hocus', 'group-hocus', 'can-hover', 'no-hover', 'responsive']).then(css => {
163147
expect(css).toMatchCss(`
164148
.w-1\\/2 {
165149
width: 50%;
166150
}
167-
.checked\\:w-1\\/2:checked {
168-
width: 50%;
169-
}
170151
.group:focus-within .group-focus-within\\:w-1\\/2 {
171152
width: 50%;
172153
}
@@ -199,9 +180,6 @@ test('all variants can be chained with the responsive variant', () => {
199180
.sm\\:w-1\\/2 {
200181
width: 50%;
201182
}
202-
.sm\\:checked\\:w-1\\/2:checked {
203-
width: 50%;
204-
}
205183
.group:focus-within .sm\\:group-focus-within\\:w-1\\/2 {
206184
width: 50%;
207185
}
@@ -236,7 +214,7 @@ test('all variants can be chained with the responsive variant', () => {
236214
});
237215

238216
test('the variants work with Tailwind’s prefix option', () => {
239-
return generatePluginCss(['hover', 'checked', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
217+
return generatePluginCss(['hover', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
240218
prefix: 'tw-',
241219
}).then(css => {
242220
expect(css).toMatchCss(`
@@ -246,9 +224,6 @@ test('the variants work with Tailwind’s prefix option', () => {
246224
.hover\\:tw-w-1\\/2:hover {
247225
width: 50%;
248226
}
249-
.checked\\:tw-w-1\\/2:checked {
250-
width: 50%;
251-
}
252227
.hocus\\:tw-w-1\\/2:hover, .hocus\\:tw-w-1\\/2:focus {
253228
width: 50%;
254229
}
@@ -270,7 +245,7 @@ test('the variants work with Tailwind’s prefix option', () => {
270245
});
271246

272247
test('the variants work with Tailwind’s important option', () => {
273-
return generatePluginCss(['hover', 'checked', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
248+
return generatePluginCss(['hover', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
274249
important: true,
275250
}).then(css => {
276251
expect(css).toMatchCss(`
@@ -280,9 +255,6 @@ test('the variants work with Tailwind’s important option', () => {
280255
.hover\\:w-1\\/2:hover {
281256
width: 50% !important;
282257
}
283-
.checked\\:w-1\\/2:checked {
284-
width: 50% !important;
285-
}
286258
.hocus\\:w-1\\/2:hover, .hocus\\:w-1\\/2:focus {
287259
width: 50% !important;
288260
}
@@ -304,7 +276,7 @@ test('the variants work with Tailwind’s important option', () => {
304276
});
305277

306278
test('the variants work with Tailwind’s important option set to a selector', () => {
307-
return generatePluginCss(['hover', 'checked', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
279+
return generatePluginCss(['hover', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {
308280
important: '#app',
309281
}).then(css => {
310282
expect(css).toMatchCss(`
@@ -314,9 +286,6 @@ test('the variants work with Tailwind’s important option set to a selector', (
314286
#app .hover\\:w-1\\/2:hover {
315287
width: 50%;
316288
}
317-
#app .checked\\:w-1\\/2:checked {
318-
width: 50%;
319-
}
320289
#app .hocus\\:w-1\\/2:hover, #app .hocus\\:w-1\\/2:focus {
321290
width: 50%;
322291
}
@@ -338,7 +307,7 @@ test('the variants work with Tailwind’s important option set to a selector', (
338307
});
339308

340309
test('the variants work on utilities that include pseudo-elements', () => {
341-
return generatePluginCss(['hover', 'checked', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {}, {
310+
return generatePluginCss(['hover', 'hocus', 'group-hocus', 'can-hover', 'no-hover'], {}, {
342311
'.placeholder-gray-400::placeholder': {
343312
'color': '#cbd5e0',
344313
},
@@ -350,9 +319,6 @@ test('the variants work on utilities that include pseudo-elements', () => {
350319
.hover\\:placeholder-gray-400:hover::placeholder {
351320
color: #cbd5e0;
352321
}
353-
.checked\\:placeholder-gray-400:checked::placeholder {
354-
color: #cbd5e0;
355-
}
356322
.hocus\\:placeholder-gray-400:hover::placeholder, .hocus\\:placeholder-gray-400:focus::placeholder {
357323
color: #cbd5e0;
358324
}

0 commit comments

Comments
 (0)