Closed JaneOri closed 2 years ago
Thanks! I think this makes sense, if that's what content does we should have parity there.
I also like the text-joiner idea. That would mean that text
and text-joiner
would be longhand properties for a shorthand (I guess?). Don't know if I want to go there just yet but something worth tracking for sure.
Maybe we could say if text
is set to a list longer than 2 items, the last item is the joiner? So text
is the shorthand
Then text-content
is the list longhand for the individual text items
and text-joiner
is the joiner longhand, defaulting to empty string
As for parity of that idea:
Many shorthand CSS properties have some degree of order-is-important. As an extreme case, the font
shorthand specifically has order-is-important paired with specific types being a sort of required landmark in the middle to help with parsing of it, which is much more complicated than this idea (and probably part of why font
shorthand is rare-ish).
I imagine text-content
will be used more than text
in Corset if this idea moves forward too but there is an intuitive assumption I get just from seeing text: var(--a) var(--b) var(--c) ", ";
and I think maybe others would too :)
An example of this working with content: https://codepen.io/matthewp/pen/zYPmpNZ
v0.8.10
text: "hello" var(--c) "world";
if --c isn't set, that results in
"hello,,world"
being insertedin CSS,
content
would concatenate them directly without the comma joiner so"helloworld"
would ideally be the result insteadIt could be interesting to have a separate
text-joiner
property that specifies what the joiner string is though, defaulting to empty string