Skip to content

Commit

Permalink
feat: add exhaustive pseudo-class and pseudo-element variant support (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Jun 23, 2021
1 parent 09a164a commit 9cb18e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli/core/ClassnamesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ export class ClassnamesGenerator {
const allVariants = [
'responsive', 'motion-safe', 'motion-reduce', 'first', 'last', 'odd', 'even', 'visited', 'checked',
'group-hover', 'group-focus', 'focus-within', 'hover', 'focus', 'focus-visible', 'active', 'disabled',
// Exhaustive pseudo-classess
'only', 'first-of-type', 'last-of-type', 'only-of-type', 'target', 'default', 'indeterminate',
'placeholder-shown', 'autofill', 'required', 'valid', 'invalid', 'in-range', 'out-of-range',
// New peer-*, selection & marker variants
'peer-hover', 'peer-checked', 'peer-focus', 'selection', 'marker'
];

// HACK: This block is just to make accessibility object align with other types object shape
Expand Down Expand Up @@ -436,6 +441,8 @@ export class ClassnamesGenerator {
if (this.isJitModeEnabled()) {
// Enable all variants
pseudoClassesVariantsForKey = allVariants;
// Add 'peer' utility classname. used with peer-* classnames
pseudoClasses.push('peer');
}

// Generate the classname of each variant...
Expand Down

0 comments on commit 9cb18e6

Please sign in to comment.