- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Tue, 19 Apr 2022 14:43:29 +0000
- To: public-css-archive@w3.org
> > Yes, 1 dimensional images are still `<image>`. > > I assume by that you mean to add `stripes()` to `<image>` but in properties like `border-color` and `outline-color` only `stripes()` is allowed, not the whole `<image>` syntax, right? These properties should accept a 1 dimensional image, not `stripes()` specifically. That way, we can add more forms for creating 1 dimensional images in the future or functions that operate on them and not have to update a bunch of grammars. In general, defining input in terms of types is better than defining it in terms of syntax. > > > I suppose we'd need to define some handling for when a 1d image is used raw in places that expect a 2d image. E.g. it could be converted to a 2d image via horizontal or vertical repetition (or stretching). 🤷🏽♀️ > > > There's no "natural" way to tile a 1d image into 2d; at minimum, vertical or horizontal tiling are both completely reasonable. We could choose one way arbitrarily if we wanted, I suppose. > > Tiling or stretching sounds reasonable. Just to be clear we're on the same page here, I have two examples for a 100px by 100px image using `stripes(red, yellow, lime, blue)`: > > Horizontal tiling: ![stripes(red, yellow, lime, blue) interpreted with horizontal tiling](https://user-images.githubusercontent.com/958943/154155035-6fb894aa-1382-454f-8f69-318c1d85b36e.png) > > Vertical tiling: ![stripes(red, yellow, lime, blue) interpreted with vertical tiling](https://user-images.githubusercontent.com/958943/154155571-11bacdd1-b6b6-4461-998f-e202b8d7bef8.png) > > Correct? > > If so, I'd aim for the same behavior as for `linear-gradient()`, i.e. draw them from top to bottom, tiling (or stretching) them horizontally (like in the first example above). This will also allow to use it in `linear-gradient()` as mentioned earlier without surprises. Just to be clear, `strips()` in `linear-gradient()` (or `radial-gradient()`, or `conic-gradient()`) would get the directionality of the gradient. The default directionality we are discussing here only applies when a 1 dimensional image is used by itself in contexts that expect a 2d image. E.g. when you do `background: stripes(...);`. -- GitHub Notification of comment by LeaVerou Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2532#issuecomment-1102742550 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 19 April 2022 14:43:30 UTC