-
Notifications
You must be signed in to change notification settings - Fork 27
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
background-clip: text #716
Comments
https://wpt.fyi/results/css/css-backgrounds?label=master&label=experimental&aligned&q=clip is probably a decent starting point |
The new/experimental |
Metrics from Chrome Status:
not sure if there's a way to get specific numbers for the |
This is specifically regarding the the lack of existing tests for multiple This sort of case as mentioned in the Firefox bug from the OP: background-image: linear-gradient(), linear-gradient();
background-clip: text, border-box In this case one of the gradients would be being used as a "text fill" and the other as an actual So something similar without the A similar issue exists with a lack of tests for a background-color: red;
background-image: linear-gradient(), none;
background-clip: text, border-box Here again the gradient is applied as a text fill and the image value of |
Description
This is now supported unprefixed and in the shorthand in all browsers, but bugs still remain.
Most notable ones, both related to multiple background layers:
background-clip
value istext
, but not all of them are, the result is incorrect.background
layer clipped totext
, this breaksbackground-blend-mode
The majority of my most common uses for
background-clip: text
involve blending twobackground
layers out of which only one is clipped totext
.So I most commonly have to resort to an absolutely positioned pseudo-element covering its parent. The pseudo then gets blended with its parent's text content.
This can be problematic for inline elements like links. Let's say we want an on
:hover
/:focus
XOR effect created with thedifference
blend mode. All is fine if the link doesn't wrap.:hover
case scenarioBut if the link wraps, we have a problem.
the problem with multi-line links
To get around this, I have to make the link
inline-block
. Which also breaks when the link is wider than is container. To also avoid that problem, I need to wrap the link text inside a span which I then blend with the actual link. Which works, but isn't ideal.Specification
CSS Backgrounds and Borders Module Level 3
Additional Signals
No response
The text was updated successfully, but these errors were encountered: