-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
Description
In #2532 it was discussed to allow one-dimensional images in two-dimensional contexts. Lately it was resolved to discuss this feature separately from the original use case of one-dimensional images.
So far, there were four ideas and opinions on them. I've summarized them here (in the order they were mentioned) including their pros and cons:
-
Add
<1d-image>directly to<image>Example:
background-image: stripes(red, yellow, lime, blue); shape-outside: stripes(black, transparent 20%);
Pros:
- 1D images can be used everywhere where
<image>is supported
Cons:
- No directionality (only from top to bottom), so, very limited use (could be mitigated by introducing image manipulations as discussed in [css-images] @image rule for manipulating images #6807)
- 1D images can be used everywhere where
-
Add
<1d-image>to existing gradient functionsExamples:
background-image: linear-gradient(45deg, stripes(red, yellow, lime, blue)); shape-outside: radial-gradient(stripes(black, transparent 20%));
Pros:
- Existing gradient functionality is reused
- Syntax is reused in different contexts
- Besides linear stripes also radial and conical stripes and their repeating variants possible
Cons:
- Nested functions
- Semantically incorrect
-
Create separate stripes functions
background-image: linear-stripes(45deg, red, yellow, lime, blue); shape-outside: radial-stripes(black, transparent 20%);
Pros:
- Similar to gradients without nesting
Cons:
- Behavior of thickness different to length in gradients
- No reuse of
<1d-image>
-
Add keyword to existing gradient functions
background-image: linear-gradient(45deg stripes, red, yellow, lime, blue); shape-outside: radial-gradient(stripes, black, transparent 20%);
Pros:
- Existing gradient functionality is reused
- No nesting
Cons:
- Behavior of thickness different to length in gradients
- No reuse of
<1d-image>
Sebastian