Bug 277549 - Add <image-1D> stripes() function to border-color and outline-color properties
Summary: Add <image-1D> stripes() function to border-color and outline-color properties
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://drafts.csswg.org/css-images-4...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-08-02 06:17 PDT by Josh Tumath
Modified: 2024-08-09 06:18 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Tumath 2024-08-02 06:17:32 PDT
The css-images-4 spec specifies a new type called <image-1D> which defines the new stripes() function. The new type can be used on the outline-color and border-color properties. It allows borders and outlines to be made up of multiple sets of colours. The author has control over the thickness of each stripe.

The stripes() function is particularly important for creating accessible focus ring designs. By using multiple colours like black and white, the author can ensure that their focus ring will be visible against any background.

For example:

  outline-color: stripes(red 1fr, green 2fr, blue 2px);

The thickness value can be omitted, implying a value of 1fr:

  outline-color: stripes(black, white);

Specifications:

https://drafts.csswg.org/css-images-4/#typedef-image-1d
https://drafts.csswg.org/css-borders-4/#border-color
https://drafts.csswg.org/css-ui-4/#outline-color
Comment 1 Radar WebKit Bug Importer 2024-08-09 06:18:12 PDT
<rdar://problem/133536559>