-
Notifications
You must be signed in to change notification settings - Fork 44
We should generate the shorthands data from longhands #26
Comments
That would also solve the issue we have with "overflow" where Edge and Chrome do things differently. |
Possible improvements, in order of easiness:
|
Great comments! For posterity, here are some details:
|
There is one slight concern with option 2, for it cannot possibly differentiate between explicit and implicit declarations for interpolated declarations such as For example: padding: 1em;
padding-bottom: 0; which is equivalent to: padding: 1em 1em 0; which results in (and is equivalent to): padding-top: 1em;
padding-right: 1em;
padding-bottom: 0px;
padding-left: 1em; I'm not sure if the purpose of the tool is to provide such detailed insight, so I may be overcomplicating the issue, in which case I'd aim for option 1 and simply explain (and/or refer to the CSS-specification) how shorthand declarations are always expanded to their longhand counterparts. |
I agree, in the short term we will look at a way to clarify the serialization issue with |
So this is actually defined in the custom props specification, I've sent an email to the list to help get this clarified in the CSSOM spec. We'll still come up with a way to word this and map them to one another somehow. Initially, in a simple way, but we may (if a shorthand exists) pull in the longhand info in a meaningful way somehow. |
Microsoft Developers, you should label yourself as "Microsoft Edge member". Like Kodi does here: So it's more obvious who is who. ;) Sorry for off topic. Would help.. Thank you. |
Done. Thanks for mentioning it. |
A person on twitter had a good idea for clearing up the confusion initially by removing the shorthands until we determine a way to populate them. I was thinking about this, and one way we could do this is while iterating over every node, do a I'll go glance at what the spec says to do here. |
The spec says to serialize the shorthand if it can accurately reflect the longhands, or return an empty string otherwise: https://www.w3.org/TR/cssom-1/#serialize-a-css-value So, if you have a https://codepen.io/AmeliaBR/pen/QOXdMz/?editors=1111 Chrome matches the spec. WebKit serializes the shorthand even if there are affected longhands that can't be represented (also, it's not including |
The "padding" property shows up in cases where browsers cannot unfold to longhands.
We have the data for the longhands; we should use that to "build" the shorthand data...
The text was updated successfully, but these errors were encountered: