Replies: 17 comments 1 reply
-
Alternatively, |
Beta Was this translation helpful? Give feedback.
-
I favour your second option @benface. The nature of Tailwind and css utilities ideally is that each class does its own thing. So I’d say the second option seems more suited and flexible. |
Beta Was this translation helpful? Give feedback.
-
Can you provide an example of where this would be useful? I can't for the life of me get |
Beta Was this translation helpful? Give feedback.
-
Got an example: |
Beta Was this translation helpful? Give feedback.
-
I use a lot on table cells. |
Beta Was this translation helpful? Give feedback.
-
After a discussion with Adam on Slack, I think the best solution would be a new utility that sets just one property: .ellipsis {
text-overflow: ellipsis;
} Because there is already a <div class="truncate">To truncate one line of text, without wrapping</div> or <div class="ellipsis overflow-hidden">To truncate when the text cannot wrap anymore</div> |
Beta Was this translation helpful? Give feedback.
-
@adamwathan Interested in a PR that adds this class? .ellipsis {
text-overflow: ellipsis;
} |
Beta Was this translation helpful? Give feedback.
-
Hey @adamwathan I see you've been closing many issues today, what are your thoughts about this? |
Beta Was this translation helpful? Give feedback.
-
Still open to adding it just not sure where it should live. Would probably want to add an "undo" utility that sets |
Beta Was this translation helpful? Give feedback.
-
Oh yeah, @hacknug and myself have put some thought into it here: benface/tailwindcss-typography#5 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Yeah, I suggested Right now core uses two conventions for text utilities: Another option I don't like a lot would be |
Beta Was this translation helpful? Give feedback.
-
Even Would |
Beta Was this translation helpful? Give feedback.
-
@adamwathan What do you think about: .ellipsis {
text-overflow: ellipsis;
}
.no-ellipsis {
text-overflow: clip;
} |
Beta Was this translation helpful? Give feedback.
-
What's wrong with |
Beta Was this translation helpful? Give feedback.
-
@robclancy Yeah those are good options too, but I suggested the above to make it obvious that the |
Beta Was this translation helpful? Give feedback.
-
@adamwathan May I know why you created .truncate {
@apply overflow-hidden text-ellipsis whitespace-nowrap
}
However, the document's reference to
|
Beta Was this translation helpful? Give feedback.
-
I know there is a
truncate
utility:But I suggest adding an
ellipsis
utility that doesn't truncate unless absolutely necessary (when the text cannot wrap anymore):Beta Was this translation helpful? Give feedback.
All reactions