Skip to content

Conversation

@Juice10
Copy link
Member

@Juice10 Juice10 commented Nov 7, 2022

Chrome outputs -webkit-background-clip as background-clip in CSSStyleRule.cssText.
But then Chrome ignores background-clip as css input.
This PR re-introduces -webkit-background-clip to fix this issue.

Vadman97 added a commit to highlight/highlight that referenced this pull request Nov 8, 2022
Vadman97 added a commit to highlight/highlight that referenced this pull request Nov 11, 2022
@Yuyz0112 Yuyz0112 merged commit 9bbc3e0 into master Nov 12, 2022
@Juice10 Juice10 added the 2.0 label Dec 1, 2022
@YunFeng0817 YunFeng0817 deleted the @juice10/background-clip-text branch January 10, 2023 03:56
!cssText.includes(' -webkit-background-clip: text;')
) {
cssText = cssText.replace(
' background-clip: text;',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javascript replace notoriously only replaces the first occurrence right?

Suggest

-      ' background-clip: text;',
-      / background-clip: text;/g,

or similar with a precompiled regex

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Can you make a PR for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure: #1476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants