-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove text opacity CSS variables from
::marker
(#8622)
* Refactor * Allow parallel variant fns to mutate the container * Remove text color variable from marker pseudo class wip * Update changelog
- Loading branch information
1 parent
22eaad1
commit 15dc5a3
Showing
7 changed files
with
115 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* This function removes any uses of CSS variables used as an alpha channel | ||
* | ||
* This is required for selectors like `:visited` which do not allow | ||
* changes in opacity or external control using CSS variables. | ||
* | ||
* @param {import('postcss').Container} container | ||
* @param {string[]} toRemove | ||
*/ | ||
export function removeAlphaVariables(container, toRemove) { | ||
container.walkDecls((decl) => { | ||
if (toRemove.includes(decl.prop)) { | ||
decl.remove() | ||
|
||
return | ||
} | ||
|
||
for (let varName of toRemove) { | ||
if (decl.value.includes(`/ var(${varName})`)) { | ||
decl.value = decl.value.replace(`/ var(${varName})`, '') | ||
} | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters