Skip to content

Commit

Permalink
Rename default variant to DEFAULT
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Oct 16, 2020
1 parent 11690b4 commit dbc7dc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/variantsAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ test('the built-in variant pseudo-selectors are appended before any pseudo-eleme

test('the default variant can be generated in a specified position', () => {
const input = `
@variants focus, active, default, hover {
@variants focus, active, DEFAULT, hover {
.banana { color: yellow; }
.chocolate { color: brown; }
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/substituteVariantsAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ function generatePseudoClassVariant(pseudoClass, selectorPrefix = pseudoClass) {
}

function ensureIncludesDefault(variants) {
return variants.includes('default') ? variants : ['default', ...variants]
return variants.includes('DEFAULT') ? variants : ['DEFAULT', ...variants]
}

const defaultVariantGenerators = config => ({
default: generateVariantFunction(() => {}),
DEFAULT: generateVariantFunction(() => {}),
'motion-safe': generateVariantFunction(
({ container, separator, modifySelectors }) => {
const modified = modifySelectors(({ selector }) => {
Expand Down

0 comments on commit dbc7dc6

Please sign in to comment.