-
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
CSS Math Functions #149
Comments
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! |
Hi @gsnedders, I've updated the "rationale" section. I added my personal rational and my specific needs. |
|
There were some mentions of math functions in State of CSS 2022, although not enough to make the top list in #248. Most of those were about
|
In the MDN short survey on CSS & HTML, "CSS math functions ( |
State of CSS 2022 - no results yet... MDN CSS & HTML survey - quite high demand, 4th place out of 20. |
This might have something to do with the wording of the questions. They're not something that I see as completely missing, as there is a spec, Safari supports them, Firefox supports a few of them. At the same time, given that both Safari and Firefox implementations are pretty new, from this year, the lack of support in Chromium is not yet at frustrating levels. I'm a lot more frustrated by the lack of support for the |
@thebabydino the wording of the question in State of CSS 2022 was:
It was a freeform text question. The most common answer ( Of course a lot of things can affect whether a feature is top-of-mind enough to show up in a question like this, for example I suspect it's much easier to remember and name a single big feature like "container queries" than a collection of functions like this one. |
@foolip My point was that in the case of mathematical functions, the implementations that do exist haven't been around enough for this to be an issue. The Safari and Firefox implementations are from this year. I've barely had time to get a bunch of demos done to get a feel for how they work, if there are still bugs to be ironed out (fortunately, haven't hit any). They're a brand new thing I'm just happy I can finally test in some browsers. I haven't arrived at the point where the lack of support in Chromium browsers is a pain yet and I personally took this question as a "place to complain about things where imperfect support frustrates you". As for There's also the fact that in general, it's easy to forget things if they're not right in front of you. A couple of days after taking the survey, I ran into something that I had forgot to mention as an answer here. And some things can change fast. Last weekend, I ended up using for the first time one of the features I labeled as "never heard of" when I took the survey. I happened to see it in someone else's code, had a "what the hell is this anyway?" moment, looked it up and then ended up using it myself. |
That was the intention with that question, yeah. There were also these two questions:
The idea was that whatever stage a feature is in, it could make sense to mention somewhere. I haven't analyzed the freeform text responses to the other two questions (it's time consuming!) but I took a look for math mentions and found these:
The first 4 was in the "missing" question and the last was from the "other" question. I can't say for sure without vetting all responses, but I think this won't make the top 20 for either question. There is some signal though, I'm not arguing against the feature being useful. |
@xiaochengh has said that |
Both Safari and Firefox correctly implemented See the Web Platform Tests - https://wpt.fyi/results/css/css-values/acos-asin-atan-atan2-computed.html?label=master&label=experimental&aligned&view=subtest |
@xiaochengh does that test cover the case you had in mind? AFAICT they all have the same unit for the first and second argument, is the problematic case when it's two different units? |
@foolip No, it doesn't.
More precisely, when there are relative length units to resolve (like the case you gave). In this case, Safari seems to just ignore the units, while Firefox treats it as a parse error. |
Thank you for proposing CSS Math Functions for inclusion in Interop 2023. We are pleased to let you know that this proposal was accepted as the Math Functions 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
Cross-browser support for CSS Math Functions:
round()
,mod()
,rem()
sin()
,cos()
,tan()
,asin()
,acos()
,atan()
,atan2()
pow()
,sqrt()
,hypot()
,log()
,exp()
abs()
,sign()
Rationale
Developer needs:
Impact:
Browser compatibility:
Safari is leading the way on support. Firefox is catching up.
layout.css.trig.enabled
flag.Specification
https://w3c.github.io/csswg-drafts/css-values-4/#math
Tests
Web Platform Tests:
Bug Tracking
WebKit Bugzilla:
Mozilla Bugzilla:
Chromium Bugs:
BCD / MDN
Too many BCD/MDN links, check the main ones:
But, we will finish documenting all the math functions very soon.
The text was updated successfully, but these errors were encountered: