Page MenuHomePhabricator

RGBA hexadecimal value is not supported in background-color (no support for transparency value)
Closed, ResolvedPublicFeature

Description

Steps to Reproduce:

  1. Open https://en.wikipedia.org/w/index.php?title=Template:Ordered_list/styles.css&action=submit (a nonexistent document)
  2. Add * { background-color: #aaaaaaaa }
  3. Click "Show Preview"

Actual Results:

Invalid or unsupported value for property background-color at line 1 character 23.

Expected Results:

This is a widely supported syntax, it should be supported.

This is supported by Color 4, as of April 2022 a W3C working draft.

Details

Related Changes in Gerrit:

Event Timeline

Aklapper renamed this task from RGBA hexadecimal value is not supported in background-color to RGBA hexadecimal value is not supported in background-color (no support for transparency value).Oct 15 2020, 9:08 PM

CSS3 colors seem to be compatible with all Grade C+ browsers according to https://caniuse.com/css3-colors, so there is no blocker on this?

I have searched for more listed features:

rgb(), hsl(), rgba() and hsla() seem to be compatible with all Grade C+ browsers except Android 4.3+, which is noted as 'support unknown'.
Anyway, if #rrggaabb is unofficial, does it mean this task should be declined? Or be retitled to support other opacity features?

Anyway, if #rrggaabb is unofficial, does it mean this task should be declined?

I believe you just found a bug in caniuse. Could you file an issue there and cc me?

I think I can't because I am not sure about #rrggbbaa. it is not found on https://www.w3.org/TR/css-color-3/ but described on mdn web docs.

Izno changed the subtype of this task from "Bug Report" to "Feature Request".Jan 14 2023, 1:55 AM

Change #1152895 had a related patch set uploaded (by Alistair3149; author: Alistair3149):

[css-sanitizer@master] Add support for alpha value in hex color notation

https://gerrit.wikimedia.org/r/1152895

Change #1152895 merged by jenkins-bot:

[css-sanitizer@master] Update Color to Level 4

https://gerrit.wikimedia.org/r/1152895

图片.png (257×925 px, 26 KB)
4 or 8-digit hex colors still not supported. However, I can use rgba() as a workaround.

图片.png (257×925 px, 26 KB)
4 or 8-digit hex colors still not supported. However, I can use rgba() as a workaround.

The css-sanitizer has been updated to support this syntax, but TemplateStyles in REL1_XX branches does not require the updated css-sanitizer library, only in master branch.

SD0001 assigned this task to alistair3149.
SD0001 subscribed.

This is fixed in css-sanitizer 6.0.0