Add CSS writing-mode classes to Tailwind #2494
Replies: 12 comments 5 replies
-
That's some good stuff right there, @MartinHughes-BPC 🎉 This is a pretty neat first plugin, thanks for sharing! 👍 Just copy/pasted your plugin + example HTML in my local project, and confirming it works nicely! That's a great example of how straightforward it is to add new utilities to Tailwind CSS. Thanks again for sharing! |
Beta Was this translation helpful? Give feedback.
-
I think this should just be added to tailwind by default. |
Beta Was this translation helpful? Give feedback.
-
After some frustration using just transform and rotate, I think this would be the final solution as using rotation methods tend to screw up layout. |
Beta Was this translation helpful? Give feedback.
-
This works great, thanks. Perhaps a good idea to add browser-specific variants to the classes too: -webkit-writing-mode: vertical-lr;
-ms-writing-mode: vertical-lr; |
Beta Was this translation helpful? Give feedback.
-
any updates on this? |
Beta Was this translation helpful? Give feedback.
-
Would be cool to add for sure — the hard/slow part is always nailing down the API. Right now we're busy with higher priority things so not actively working on this, but you can use arbitrary properties for this until we add it as a feature of the framework: <div class="[writing-mode:vertical-lr] ..."> |
Beta Was this translation helpful? Give feedback.
-
thank you so much @MartinHughes-BPC!!! I was stuck on this issue for the days. Came across this post and it solved everything. Thank you so so much and really appreciate your contribution to the community! |
Beta Was this translation helpful? Give feedback.
-
I really appreciate this! And I agree that this should be added to Tailwind Core |
Beta Was this translation helpful? Give feedback.
-
Really good solution and I am also think that it should be added to Tailwind CORE. |
Beta Was this translation helpful? Give feedback.
-
This is incredible. Thank you!! @MartinHughes-BPC |
Beta Was this translation helpful? Give feedback.
-
Just a note, if you also need to use sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
} |
Beta Was this translation helpful? Give feedback.
-
Hi Adam and team,
I've been experimenting with writing my first plugin, which adds CSS writing-mode utilities to Tailwind. This might be useful for languages that are laid out that way, but my use is far more pragmatic - they make it super simple and easy to have vertical text with other content without having to use absolute positioning, large extended borders for background color and the other complexities that ensue. They also pay nicely with other utilities such as rotate and text align so you can get the effect you want.
Here is my attempt at the plug-in:
And here are a couple of example of it in action:
Beta Was this translation helpful? Give feedback.
All reactions