@regiscamimura/_tw_typography
v0.5.1
Published
A fork of Tailwind Typography to support _tw’s requirements.
Downloads
5
Readme
_tw Typography
A fork of Tailwind Typography that:
- Removes the
className
argument, replacing it with separate arguments forpostTitleSelector
andpostContentSelector
- Uses a plain
body
selector whenpostContentSelector
isfalse
These changes generate editor styles compatible with the WordPress block editor and also apply Tailwind Typography’s h1
styles to headings with the appropriate post title selector (e.g., .entry-title
) regardless of heading level.
The version number of this fork will be kept in sync with that of Tailwind Typography itself.
Usage
For frontend styles:
// tailwind-frontend.config.js
module.exports = {
presets: [
require( './tailwind.config.js' ),
],
plugins: [
require( '@tailwindcss/typography' )(),
],
};
For editor styles:
// tailwind-editor.config.js
module.exports = {
presets: [
require( './tailwind.config.js' ),
],
plugins: [
require( '@tailwindcss/typography' )( {
postTitleSelector: '.editor-post-title__block .editor-post-title__input',
postContentSelector: false,
} ),
],
};
To find Tailwind Typography styles optimized for the WordPress editor, please see the tailwind/tailwind-typography.config.js
file in the _tw repository.