Skip to content

Commit

Permalink
feat: add 'marker:' variant (#635)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
Techassi and antfu committed Dec 29, 2021
1 parent 9529357 commit ff6f698
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config/order.ts
Expand Up @@ -46,6 +46,7 @@ export const variantOrder = [
'file-selector-button',
'file',
'selection',
'marker',
'svg',
'all',
'children',
Expand Down
1 change: 1 addition & 0 deletions src/lib/variants/state.ts
Expand Up @@ -62,6 +62,7 @@ export function generateStates (
'file-selector-button': () => new Style().pseudoElement('file-selector-button'),
file: () => new Style().pseudoElement('file-selector-button'),
selection: () => new Style().pseudoElement('selection'),
marker: () => new Style().wrapSelector(selector => `${selector} *::marker, ${selector}::marker`),

svg: () => new Style().child('svg'),
all: () => new Style().child('*'),
Expand Down
1 change: 1 addition & 0 deletions test/processor/__snapshots__/variant.test.ts.yml
Expand Up @@ -86,6 +86,7 @@ Tools / generate states / all / 0: |-
"file-selector-button": ".test::file-selector-button {\n background: #1C1C1E;\n}",
"file": ".test::file-selector-button {\n background: #1C1C1E;\n}",
"selection": ".test::selection {\n background: #1C1C1E;\n}",
"marker": ".test *::marker, .test::marker {\n background: #1C1C1E;\n}",
"svg": ".test svg {\n background: #1C1C1E;\n}",
"all": ".test * {\n background: #1C1C1E;\n}",
"children": ".test > * {\n background: #1C1C1E;\n}",
Expand Down
2 changes: 1 addition & 1 deletion test/processor/resolve.test.ts
Expand Up @@ -29,7 +29,7 @@ describe('Resolve Tests', () => {
'even-of-type', 'odd-of-type', 'root',
'empty', 'before', 'after',
'first-letter', 'first-line', 'file-selector-button',
'file', 'selection', 'svg',
'file', 'selection', 'marker', 'svg',
'all', 'children', 'siblings',
'sibling', 'ltr', 'rtl',
'group-hover', 'group-focus', 'group-active',
Expand Down

0 comments on commit ff6f698

Please sign in to comment.