interop icon indicating copy to clipboard operation
interop copied to clipboard

Consistent color for ridge/groove borders

Open chriskirknielsen opened this issue 1 year ago • 2 comments

Description

When using the special 3D-esque border-style values of ridge or groove, browsers render them with very inconsistent shifts in color when using darker colors:

Firefox

border render in Firefox, very dark all around Remains close to the source color, the effect being subtle for darker colors

Chrome

border render in Chrome, the colors contrast a lot Pushes to the extremes for the light and dark versions, creating a sharp contrast

Safari

border render in Safari, colors are significantly brighter than the source value Brightens the color a lot before creating a slightly darker and lighter version

In my tests, I am using a dark brown (#2f1913), where this difference is very noticeable. However, if you use a native red value, it looks consistent across all 3 major browsers.

You can check the result in this demo: [interop issue] ridge and groove border-style cross-browser differences (update the --c property to change the colors).

Obviously, this is a very low priority, but it still would be nice to get consistency across browsers!

Specification

W3C

Additional Signals

No response

chriskirknielsen avatar Sep 24 '24 16:09 chriskirknielsen

Potentially slightly related: #713

chriskirknielsen avatar Sep 24 '24 16:09 chriskirknielsen

Not ridge/grove/inset/outset related but found out Safari still doesn't have circular dotted borders for border-style: dotted; It also breaks pretty badly when you add a border-radius above 6px.

(FYI, I remember Chrome having these same issues at one point but they have since been fixed)

https://codepen.io/jsnkuhn/pen/MWNYYMZ

image

jsnkuhn avatar Sep 24 '24 20:09 jsnkuhn

There is no standard for this yet, see: https://github.com/w3c/csswg-drafts/issues/9393

nt1m avatar Oct 01 '24 21:10 nt1m

@nt1m Oh thank you for sharing, I had not seen this… thought I might be the only person to have tried to use these border styles in this century haha. (I see we both ran into this issue while making our websites 😅)

chriskirknielsen avatar Oct 01 '24 22:10 chriskirknielsen

I implemented the WebKit algorithm to honor the border-color with 3D styles and I'm also disappointed by the lack of standard. Happy to align to whatever algorithm ends up being standardized.

nt1m avatar Oct 01 '24 22:10 nt1m

Thank you for proposing Consistent color for ridge/groove borders for inclusion in Interop 2025.

We wanted to let you know that this proposal was not selected to be part of Interop this year.

On behalf of the entire Interop team, thank you for submitting this proposal for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2025.

Posted on behalf of the Interop team.

wpt-interop avatar Feb 13 '25 17:02 wpt-interop