-
Notifications
You must be signed in to change notification settings - Fork 713
[css-borders] accept "px" for pixel values in border-image-slice
#6739
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
Comments
The original motivation for this syntax, if I remember correctly, was to be useful for image formats that might not use actual pixels, such as SVG. So the idea was that they were abstract coordinates, not a length of some unit type. That said, I think accepting |
I don't recall the exact reasoning, but I'll note that SVG's "abstract units" are just |
Will |
If we allowed a |
(Also css-backgrounds-3 is basically a REC that's just missing an implementation report so definitely anything other than an error correction goes in css-backgrounds-4.) |
I'm still confused. What is fundamentally different about |
border-image-slice
I believe it makes sense to allow pixel values in that case as well. As @jsnkuhn pointed out earlier, the CSS pixels vs. image pixels applies in other situations as well, so authors should already be aware of that. Sebastian |
The basic difference here, I think, is that these values are intended to be image pixels, not CSS pixels. These are fundamentally different thing. The example of background image spriting using |
The CSS Working Group just discussed
The full IRC log of that discussion<Frances> Sebastian: Suggested to allow pixel unit for border-image-slice. For authors it is easier to express in pixel values.<emilio> q+ <TabAtkins> q+ <Frances> Sebastian: Pixel unit is meant for CSS pixels, from an authors perspective it looks weird to have a unitless number for slicing. Would like to possibly introduce a pixel unit. <astearns> ack emilio <Frances> Emilio: Is there a use case for a non pixel length? <Frances> Sebastian: Would just be pixels. <kizu> q+ <astearns> ack TabAtkins <Frances> Emilio: Either come up with a different unit and use calc() with it, or treat pixels as arbitrary lengths. <Frances> Emilio: Slightly against <emilio> emilio: it'd be unfortunate if e.g. the zoom property affected this <Frances> Tab: Also slightly against. Pixels to allowed but not others, can put px at the end of a number but nothing else, could end up being confusing. <astearns> ack kizu <SebastianZ> q+ <Frances> Roman: For non pixels in any length is if using css gradient and slice using the same thing for the stop of the gradient. <astearns> ack SebastianZ <Frances> Roman: Might not be worth introducing a change. <Frances> Sebastian: Are there other use cases other than border-image-slice? If other use cases for a new pixel unit, could introduce in border-image-slice, until then, we can resolve not to add the px unit. <Frances> Alan: Let's resolve <lea> As Roman said, I do think `border-image` is rotten at the core and needs a complete re-architecting, but no cycles to work on that rn. I would weakly support this change, but it doesn't make much of a difference <Frances> PROPOSAL: Not going to use the pixel unit for the pixel value in border-image-slice <Frances> RESOLVED: Not going to use the pixel unit for the pixel value in border-image-slice <Frances> Alan: If we find other use cases for it, we could consider adding it to border-image-slice. Work on a replacement for border-images. |
I am going to close this issue because it is not likely that we will introduce an “image pixel” value for this particular case only. But if there are other use cases for representing image pixels in CSS values we could re-open this discussion. |
Currently
border-image-slice
only allows pixel values to be used through unit-less number values. I'm guessing there was a reason for this but in practice I have found it just confuses people and leads to them not usingborder-image
.The only concern is that there might be border-image code lying dormant on pages because folks just couldn't figure out why it wasn't working with a "px" value on pages. If folks left in to deal with later it would just start working if "px" support was added. If all of the
border-image
s values were not worked out because they couldn't get the image to show things might appear broken in these cases.https://www.w3.org/TR/css-backgrounds-3/#border-image-slice
The text was updated successfully, but these errors were encountered: