- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 29 Jun 2022 16:37:12 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `box shadows and circles`. <details><summary>The full IRC log of that discussion</summary> <TabAtkins> Topic: box shadows and circles<br> <TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7103<br> <TabAtkins> oriol: When you specify border-radius, the length is the corner radius of the outer border edge<br> <TabAtkins> oriol: For inner edge we subtract the border width from that<br> <TabAtkins> oriol: Spread is the opposite<br> <TabAtkins> oriol: Initial vaule of spread is 0 tho, so this would make an ellipitical border radius ahve corners<br> <TabAtkins> oriol: Firefox has special case for spread radius of 0, keeping it sharp. But 0.1 makes rounded corners<br> <TabAtkins> oriol: Suggest adding a correction term that gives sharp corners at 0 and continouously transforms to round.<br> <TabAtkins> oriol: So the issue: if you say border-radius:50% you get an ellipse.<br> <TabAtkins> oriol: If you have a shadow you probably also expect it will be an ellipse.<br> <TabAtkins> oriol: Blink changed impl to match the spec, and people complained their shadows were no longer circles.<br> <TabAtkins> oriol: Proposal in the issue is, instead of adding the spread distance and subtracting a correction term, we could express the border-radius as a % and then, for the shadow, we use the same % but resolved agaisnt th esize of th eshadow<br> <TabAtkins> oriol: This seems to improve various cases, we have posted images in the thread<br> <TabAtkins> oriol: Shadows look better, stay circular<br> <astearns> images in this comment: https://github.com/w3c/csswg-drafts/issues/7103#issuecomment-1146870682<br> <TabAtkins> oriol: Downside is if you specify a length, and elemnet has circular corners, shadow will have circular corners. New change will instead make them elliptical if the box isn't square<br> <TabAtkins> oriol: Vlad suggested a variant where we only resolve to a % in one axis, then keep the same aspect ratio for the corner<br> <astearns> problem ellipse images in this comment: https://github.com/w3c/csswg-drafts/issues/7103#issuecomment-1168157338<br> <TabAtkins> oriol: Problem is if th eelement is a full ellipse, you won't get an ellipse shadow. Circles stay circles but in an ellipse you'll get flat edges on the short axis.<br> <TabAtkins> oriol: I proposed another idea - we could say that for the shadow we just add spread-distance to the border-radius<br> <TabAtkins> oriol: This would imply that for 0px you'd have rounded corners<br> <TabAtkins> oriol: But we'd also change the initial value for border-radius is "none", which would stay sharp. Unsure about compat tho.<br> <TabAtkins> oriol: fantasai proposed interpolating between some radius formulas.<br> <TabAtkins> oriol: Various options, not sure which is best.<br> <TabAtkins> fantasai: Two ideas. One is the problem is largely around circular/oval shapes. Many of those are done with %s.<br> <TabAtkins> fantasai: So we could say if the radius is a % we maintain it as a % in the spread shape.<br> <TabAtkins> fantasai: Dunno if that really works since the other way to do a circle is to do a huge px length and we scale it down.<br> <TabAtkins> fantasai: So it depends on how authors are specifying things.<br> <TabAtkins> fantasai: Another possibility is to interpolate based on how much of a straight side we have.<br> <TabAtkins> fantasai: So if the straight side is longer than the radius, we use existing formula which is good for rectangular shapes<br> <TabAtkins> fantasai: If straight side is 0 we use the % formula<br> <TabAtkins> fantasai: And between we can interpolate.<br> <fantasai> TabAtkins: I hadn't gone this deep before, I suspect I have opinions, but would like to take up at a later call, maybe at F2F<br> <fantasai> fantasai: F2F sounds good, can draw stuff<br> <fantasai> astearns: Leading up to F2F, we should have a set of things to test against<br> <fantasai> astearns: We absolutely need to fix the spec<br> <fantasai> astearns: I'm not sure that we have a fix that is good enough for all the edge cases yet<br> <TabAtkins> fantasai: We have a bunch of example scurrently, both working and not.<br> <fantasai> s/have/need to have/<br> <TabAtkins> I suspect we might need to address this semantically at the border-radius side with a keyword that does ellipse.<br> <TabAtkins> astearns: Can I ask Oriol to list out the cases to consider?<br> <TabAtkins> astearns: Summarizing them in the issue, and people can respond in the issue.<br> <TabAtkins> astearns: We'll tag this for f2f and come back to it<br> <fantasai> https://drafts.csswg.org/css-backgrounds-3/spread-radius<br> <TabAtkins> fantasai: We also have this which we can update<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7103#issuecomment-1170218949 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 29 June 2022 16:37:14 UTC