Skip to content

Commit 82259c1

Browse files
committed
Remove text color variable from marker pseudo class
wip
1 parent 946045c commit 82259c1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/corePlugins.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,27 @@ import { version as tailwindVersion } from '../package.json'
1414
import log from './util/log'
1515
import { normalizeScreens } from './util/normalizeScreens'
1616
import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
17+
import { removeAlphaVariables } from './util/removeAlphaVariables'
1718
import { flagEnabled } from './featureFlags'
1819

1920
export let variantPlugins = {
2021
pseudoElementVariants: ({ addVariant }) => {
2122
addVariant('first-letter', '&::first-letter')
2223
addVariant('first-line', '&::first-line')
2324

24-
addVariant('marker', ['& *::marker', '&::marker'])
25+
addVariant('marker', [
26+
({ container }) => {
27+
removeAlphaVariables(container, ['--tw-text-opacity'])
28+
29+
return '& *::marker'
30+
},
31+
({ container }) => {
32+
removeAlphaVariables(container, ['--tw-text-opacity'])
33+
34+
return '&::marker'
35+
},
36+
])
37+
2538
addVariant('selection', ['& *::selection', '&::selection'])
2639

2740
addVariant('file', '&::file-selector-button')

tests/variants.test.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,14 @@
112112
line-height: 1.75rem;
113113
}
114114
.marker\:text-red-500 *::marker {
115-
--tw-text-opacity: 1;
116-
color: rgb(239 68 68 / var(--tw-text-opacity));
115+
color: rgb(239 68 68);
117116
}
118117
.marker\:text-lg::marker {
119118
font-size: 1.125rem;
120119
line-height: 1.75rem;
121120
}
122121
.marker\:text-red-500::marker {
123-
--tw-text-opacity: 1;
124-
color: rgb(239 68 68 / var(--tw-text-opacity));
122+
color: rgb(239 68 68);
125123
}
126124
.selection\:bg-blue-500 *::selection {
127125
--tw-bg-opacity: 1;

0 commit comments

Comments
 (0)