Skip to content

[css-borders] Standardize groove/ridge/inset/outset border-color computations #9393

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

Open
nt1m opened this issue Sep 21, 2023 · 7 comments
Open
Labels
Agenda+ Later Lower-priority items that are flagged for CSSWG discussion css-borders-4

Comments

@nt1m
Copy link
Member

nt1m commented Sep 21, 2023

It would be good to standardize those.

WebKit honors the border-color and uses a specific algorithm that has contrast issues: https://bugs.webkit.org/show_bug.cgi?id=261847

Chromium does not honor the border-color afaik and hardcodes to gray.

Gecko honors the border-color and doesn't have contrast issues: https://searchfox.org/mozilla-central/rev/077fc34d03b85b09add26b5f99f1a3a3a72c8720/gfx/wr/webrender/res/cs_border_segment.glsl#140

@nt1m
Copy link
Member Author

nt1m commented Oct 24, 2023

@fantasai fantasai added Agenda+ Later Lower-priority items that are flagged for CSSWG discussion and removed Agenda+ labels Oct 27, 2023
@nt1m
Copy link
Member Author

nt1m commented Aug 13, 2024

I just ran into this again while trying to make my site. Here are screenshots of ridge #111:

Safari:
image

Chrome (they've fixed the hardcoded to gray bug):
image

Firefox:
image

@bert-github @fantasai @LeaVerou @SebastianZ (editors of CSS borders) Can we make an HTML page with a matrix of border colors (including extremes like black and white which have special cases) and see which browser has the most sensible algorithm? That can then be standardized (and bikeshed on)

For #111, seems like Safari has the worse result (due to applying double luminance for very dark colors), so WebKit might not be the 100% ideal algorithm. Firefox shows too little contrast (https://bugs.webkit.org/show_bug.cgi?id=261847 would probably filed if this was used widely). Chrome seems to have a sensible result (although the super contrasty colors kind of ruins the 3D effect).

@smfr
Copy link
Contributor

smfr commented Nov 8, 2024

This is very visible on wikipedia right now:

chrome:
chrome

safari:
safari

firefox:
firefox

@darinadler
Copy link

So not just a theoretical concern, making the website look broken in the browsers other than the one it was tested with!

@tabatkins
Copy link
Member

I've gone ahead and started the comparison table, at https://drafts.csswg.org/css-borders-4/ridge-borders/index.html. If someone with access to Safari could add a column for their results (and add their colors to the final column), that would be great. If we need any more color comparisons, we can add those too.

@nt1m
Copy link
Member Author

nt1m commented Nov 8, 2024

@tabatkins I also started this: https://gist.github.com/nt1m/9b2d322f506f8307594deba2b827e00f#file-ridge-borders-html , feel free to upload it to the CSSWG repo.

@tabatkins
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agenda+ Later Lower-priority items that are flagged for CSSWG discussion css-borders-4
Projects
None yet
Development

No branches or pull requests

6 participants