-
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
Better Support for CSS masks #148
Comments
Awesome, was looking at this as well. Web platform tests are here (not sure if border-masking examples are included):
|
Hey—when it comes to rational we're primarily interested in web developer and/or end user impact, not the mere existence of bugs (or omitted features); one of the goals of the Interop projects is to focus on things that matter, not just to enumerate every incompatibility out there. I've opened #151 to try and clarify that in the template, but if you could expand on why you believe this feature is important that would be great! |
Can personally attest that I'd likely use CSS masking more if it just worked as expected. Wanting to pull what's left of my hair out every time I need to use masking is not a great feeling. It's been around 10 years since CSS3 when this was originally implemented, we just shouldn't still have these kind of issues after that long. When implementations are this inconsistent it means more dev time checking on browsers and devices and even if you do that (which many people won't) you still risk missing something which leads to the bad use experience. Many of the issues, it seems, come down to browser vendors needing to do some name aliasing. So much of it could be a quick win situation. |
I believe the biggest pain point in masks today is not being able to use inline SVG for masking HTML via CSS, which is, IMHO, the ultimate win of masking with vector graphics. At Wix we use masks quite extensively but were only able to use the CSS-embedded way, naturally, which is quite a hassle if you're a developer, and not a site generator program. |
So wouldn't this fall under something like |
Not really, it's using SVG's masking capabilities directly for masking by specifying a |
There seems to be web developer interest in the mask-image part of this proposal:
The other aspects of masking, other than mask-image, seem to have less developer interest, at least using these datasources (popularity and chromium bugs).
I was surprised to see this doesn't work in Chromium or WebKit, and I confirmed there are several failing WPT tests due to this. I filed https://crbug.com/1369996 to track this. |
Thanks @progers!
Some of these may be in part because of partial support of other features, like the above-mentioned. For example, if |
Am I right in thinking we're roughly looking at |
The issues as described by caniuse is:
the issues to a certain degree come down to (if i remember correctly) there being a complete redesign of the spec at one point? And some of the implementation getting updated and other not. Ana Tudor did a good job breaking down the issues with mask-compositing that also gets at some of the larger issues here: https://css-tricks.com/mask-compositing-the-crash-course/#aa-extending-support |
@gsnedders there's also this old post: https://lab.iamvdo.me/css-svg-masks/ - might be a bit dated, but roughly covers some of the main missing features. |
The Chrome bug about all of this: https://bugs.chromium.org/p/chromium/issues/detail?id=432153 For clarity: What I'm referring to here is yes The other thing being mentioned is "9. SVG Mask Sources" Referencing an inline SVG
|
We may need to debate exactly which types of "mask" is being proposed in this issue. But for CSS, there are quite a few properties that were originally The Web Almanac shows these are some of the most-tested properties listed in feature queries, taking 5th through 13th place: |
probably worth noting that this is mostly just a Chromium issue at the moment? Firefox has been good on this since 2017 and Safari unprefixed earlier this year. |
I wonder if this proposal is only one example of a larger issue. Maybe the larger proposal should just be a large scale CSS3 clean up. A big part of which would be an effort to un-prefix CSS3 properties that have fallen under the radar? Things like This chart is not super user friendly (maybe there's a better one out there) but gets the general idea of what the current-ish prefixing situation is: I guess an investigation into how many of these prefixes can just be straight up un-prefixed would be needed. It seems in some cases support for the |
There were some mentions of masks in State of CSS 2022, although not enough to make the top list in #248. 11 mentions is ~0.5% of the 1995 responses. Most were just "masks" or "CSS masking", but one comment mentioned |
In the MDN short survey on CSS & HTML, "CSS |
Chrome bug for |
Thank you for proposing CSS masks for inclusion in Interop 2023. We are pleased to let you know that this proposal was accepted as the Masking focus area. You can follow the progress of this Focus Area on the Interop 2023 dashboard. For an overview of our process, see the proposal selection summary. Thank you for contributing to Interop 2023! Posted on behalf of the Interop team. |
Description
CSS Masks seem fairly neglected. There are cool things like mask-mode which doesn't work on chrome.
Rationale
Support meets an MVP level, but the more advanced features (like mode) are inconsistent, and the prefixed versions only complicate the matter. I'd love to be able to use this one any evergreen browser without needing to test behavior on each browser individually.
Specification
W3C
https://drafts.fxtf.org/css-masking/#the-mask
Tests
Each of these properties are implemented in each browser:
mask-clip
mask-composite
mask-image
mask-mode
mask-origin
mask-position
mask-repeat
mask-size
The text was updated successfully, but these errors were encountered: