Text
Colors
red, blue, green, yellow, purple, pink, orange, gray, slate, zinc, neutral, stone, amber, lime, emerald, teal, cyan, sky, indigo, violet, fuchsia, rose.
Shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900.
Formatting
font-semibold, font-bold, font-extrabold and font-black are bold; font-thin through font-medium turn bold off, so <Text className="font-normal"> inside a heading is not bold. not-italic and no-underline turn those off.
uppercase uses Word’s All Caps format, so the underlying text keeps its case. Word has no lowercase or title-case format, so lowercase and capitalize change the text itself.
Sizes
text-xs through text-9xl, following Tailwind’s scale at 1px = 0.75pt: text-xs is 9pt, text-sm 10.5pt, text-base 12pt, text-lg 13.5pt, text-2xl 18pt.
Fonts
font-sans, font-serif and font-mono map to Arial, Times New Roman and Courier New, fonts Word has on every platform. For font stacks from a custom config, the first concrete font is used; generic names such as sans-serif and system aliases such as ui-sans-serif are skipped because Word cannot resolve them.
Super/subscript
Letter spacing
Paragraphs
Alignment
Spacing
Indentation
Line height
leading-none, leading-tight, leading-snug, leading-normal, leading-relaxed, leading-loose.
Background
Page breaks
Headings already keep with the next paragraph or table.
Arbitrary values
Square brackets set values outside the theme:px, pt, rem, em, cm, mm and in; colors must be hex. leading-[1.5] is a multiple of the line; leading-[18pt] is an exact height.
Inheritance
Classes cascade like CSS:- Inherited: text properties (color, size, font, weight, italic, underline, strikethrough, case, letter spacing, super/subscript), text alignment and line height. A class on
Document,Section,Table,Tr,UlorListyles the text inside it. - Not inherited: margins, padding, backgrounds and borders apply only to the element that declares them.
<Section className="mt-4">does not add space above every paragraph, and<Table className="border">draws the table’s borders without adding borders to each cell.
Text, Bold, Link, …) shades the text inside it, like a CSS span. A background on Tr shades the row’s cells.
Tables
Borders
border, border-0, border-2, border-4, border-8. A border color (border-gray-300) colors the sides that have a width; on its own it draws nothing, as in Tailwind.
Individual sides: border-t, border-b, border-l, border-r.
Border colors
Padding
Cell alignment
Background
Images
Object fit
Aspect ratio
Custom config
Drop atailwind.config.js (or .ts, .mjs, .cjs) in your project root. React DOCX loads it automatically. To vary the theme per document, for example per client, use the Document theme prop.
Custom colors
Custom fonts
Custom sizes
rem, px, and pt values.
Class merging
Later classes win:What doesn’t work
These have no DOCX equivalent:opacity-*z-*flex,grid,floatshadow-*rotate-*,scale-*,translate-*blur-*,brightness-*bg-gradient-*rounded-*(except on tables/cells via borders)w-*,h-*(use component props instead)
