Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-borders] allow negative values for border-image-outset #9263

Open
jsnkuhn opened this issue Aug 29, 2023 · 1 comment
Open

[css-borders] allow negative values for border-image-outset #9263

jsnkuhn opened this issue Aug 29, 2023 · 1 comment

Comments

@jsnkuhn
Copy link

jsnkuhn commented Aug 29, 2023

The spec states that negative border-image-outset values are invalid but doesn't give an explanation as to why (https://drafts.csswg.org/css-backgrounds/#border-image-outset). This functionality seems useful. Granted one can build the "inset" into the image itself but it would be better to be able to do this in CSS and not have to hard code it into an image.

outline-offset (https://drafts.csswg.org/css-ui/#outline-offset) already does some very similar to this but does not have the restriction on negative values. The outline-offset spec listing does give an explanation about limitations. I wonder if the same sort of thing could be done for border-image-outset?

Negative values must cause the outline to shrink into the border box. Both the height and the width of the outside of the shape drawn by the outline should not become smaller than twice the computed value of the outline-width property to make sure that an outline can be rendered even with large negative values. User agents should apply this constraint independently in each dimension. If the outline is drawn as multiple disconnected shapes, this constraint applies to each shape separately.

@jsnkuhn
Copy link
Author

jsnkuhn commented Aug 30, 2023

Live use case: https://robertsspaceindustries.com/

Note that the developers used border-image in other areas of this page (for example the "Play Now" button). So they know about the border-image property but seemingly specifically chose not to use it for this element and it's hover interaction.

GIF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants