Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Capture CSS background-clip: text with browser prefix #1047

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

Juice10
Copy link
Contributor

@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
Contributor 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.

3 participants