Skip to content

Commit

Permalink
Remove text color variable from marker pseudo class
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
thecrypticace committed Jun 14, 2022
1 parent ad93c10 commit cfbf1cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 14 additions & 1 deletion src/corePlugins.js
Expand Up @@ -14,14 +14,27 @@ import { version as tailwindVersion } from '../package.json'
import log from './util/log'
import { normalizeScreens } from './util/normalizeScreens'
import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
import { removeAlphaVariables } from './util/removeAlphaVariables'
import { flagEnabled } from './featureFlags'

export let variantPlugins = {
pseudoElementVariants: ({ addVariant }) => {
addVariant('first-letter', '&::first-letter')
addVariant('first-line', '&::first-line')

addVariant('marker', ['& *::marker', '&::marker'])
addVariant('marker', [
({ container }) => {
removeAlphaVariables(container, ['--tw-text-opacity'])

return '& *::marker'
},
({ container }) => {
removeAlphaVariables(container, ['--tw-text-opacity'])

return '&::marker'
},
])

addVariant('selection', ['& *::selection', '&::selection'])

addVariant('file', '&::file-selector-button')
Expand Down
6 changes: 2 additions & 4 deletions tests/variants.test.css
Expand Up @@ -112,16 +112,14 @@
line-height: 1.75rem;
}
.marker\:text-red-500 *::marker {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
color: rgb(239 68 68);
}
.marker\:text-lg::marker {
font-size: 1.125rem;
line-height: 1.75rem;
}
.marker\:text-red-500::marker {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
color: rgb(239 68 68);
}
.selection\:bg-blue-500 *::selection {
--tw-bg-opacity: 1;
Expand Down

0 comments on commit cfbf1cd

Please sign in to comment.