Re: [csswg-drafts] [css-borders][css-images] Properly address border image use cases, and kill `border-image` with fire (#9714)

It seems to me that there are two main scenarios in which authors need to decorate borders with graphics, which I find significantly different conceptually:

1. Take a specially designed predefined image and _attach_ it to the box the way that serves the artistic intent the best;
2. Take an existing border and _fill_ it with the given graphical pattern, aligning this pattern with the border geometry where needed.

It looks that features that are good for the former ("image-first") class of use cases turn into downsides for the latter ("border-first"), and vice versa. The "image-first" approach needs as many levels of control that are resonably needed for artistic purposes, it shouldn'be limited with the edges of the border area, it may need handling different parts of the image independently, and so on. On the other hand, the "border-fist" approach needs to "automagically" know the exact geometry of the border area (including external/internal roundings and even fancier future corner shapes, perhaps even dashes/dots of respective `border-style`s) and ideally should "just work" with as few prerequisites as possible.

This conceptual difference seems so significant to me that I doubt that covering both scenarios with one tool is a good idea.

The existing `border-image` design seems good enough (not perfect, but perfection is unattainable) for the first scenario but hardly suitable at all for the second one. In other words, "border-image" turns out a rather poor choice for decorating _borders_ with images, although a pretty good tool for visually enhancing _boxes_ with non-trivial graphical effects. It's only connection to the actual border area is the default `border-image-width:1`, but it works for thick rectangular borders only and unlikely has any real-life usage besides `border-image` tutorials:)

All the above leads me to conclusion that introducing a brand new simple property for the "border-first" cases (something like `border-fill` maybe?) might actually be more productive than attempting to "fix" `border-image` (along with its `mask-border` counterpart) to suit better the cases it turns out (in retrospect) not designed for 😳


-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9714#issuecomment-1877413976 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 4 January 2024 16:39:03 UTC