-
Notifications
You must be signed in to change notification settings - Fork 757
Open
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 to achieve that. The direct way of adding <1d-image> to <image> is discussed in #7241. The other three all have in common that they refer to gradients or gradient-like funcions. I've summarized them here (in the order they were mentioned) including their pros and cons:
-
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%)); background-image: linear-gradient(45deg, black, stripes(red, yellow, lime, blue) 100px, white);
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
- Allows mixing stripes and gradients
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
yisibl