Replies: 4 comments
-
This is a duplicate issue.Just found another issue opened earlier #5237 |
Beta Was this translation helpful? Give feedback.
-
I like the idea to add these two properties as new utilities. I had recently used these two properties and checked that there hasn't been any utilities for these in tailwindcss.
I would like to suggest other class names for the rules @M0hammedImran suggested. .orientation-sideways { text-orientation: sideways; }
.orientation-upright { text-orientation: upright; }
.orientation-mixed { text-orientation: mixed; }
.orientation-sideways-right { text-orientation: sideways-right; }
.orientation-glyph { text-orientation: use-glyph-orientation; } On .vertical-writing-lr { writing-mode: vertical-lr; }
.vertical-writing-rl { writing-mode: vertical-rl; }
.horizontal-writing-tb { writing-mode: horizontal-tb; } |
Beta Was this translation helpful? Give feedback.
-
Related discussions: |
Beta Was this translation helpful? Give feedback.
-
Using @jbryan11's proposed naming, as a plugin, javascript: const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin(function ({ addUtilities }) {
addUtilities({
// https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode
".horizontal-writing-tb": { "writing-mode": "horizontal-tb" },
".vertical-writing-rl": { "writing-mode": "vertical-rl" },
".vertical-writing-lr": { "writing-mode": "vertical-lr" },
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-orientation
".orientation-mixed": { "text-orientation": "mixed" },
".orientation-upright": { "text-orientation": "upright" },
".orientation-sideways-right": { "text-orientation": "sideways-right" },
".orientation-sideways": { "text-orientation": "sideways" },
".orientation-glyph": { "text-orientation": "use-glyph-orientation" },
})
}),
],
} As a plugin, typescript: import { type Config } from "tailwindcss";
import plugin from "tailwindcss/plugin";
export default {
plugins: [
plugin(function ({ addUtilities }) {
addUtilities({
// https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode
".horizontal-writing-tb": { "writing-mode": "horizontal-tb" },
".vertical-writing-rl": { "writing-mode": "vertical-rl" },
".vertical-writing-lr": { "writing-mode": "vertical-lr" },
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-orientation
".orientation-mixed": { "text-orientation": "mixed" },
".orientation-upright": { "text-orientation": "upright" },
".orientation-sideways-right": { "text-orientation": "sideways-right" },
".orientation-sideways": { "text-orientation": "sideways" },
".orientation-glyph": { "text-orientation": "use-glyph-orientation" },
});
}),
],
} satisfies Config; Not clear when they would be useful, but technically there are more values: writing-mode: inherit;
writing-mode: initial;
writing-mode: revert;
writing-mode: revert-layer;
writing-mode: unset;
text-orientation: inherit;
text-orientation: initial;
text-orientation: revert;
text-orientation: revert-layer;
text-orientation: unset; Edit: changed object keys from |
Beta Was this translation helpful? Give feedback.
-
These two properties text-orientation and writing-mode are used in conjunction to create sideways text.
I could have created add a class in the utilities layer, but I just love the VSCode intellisense.
These are some suggestions.
text-orientation
.text-sideways
.text-upright
.text-mixed
.text-sideways-right
.text-glyph
writing-mode
.writing-vertical-lr
.writing-vertical-rl
.writing-horizontal-tb
Beta Was this translation helpful? Give feedback.
All reactions