Skip to content

Commit d806948

Browse files
authored
Merge pull request #22 from ahaseeb04/amend-docs
Added a section regarding how to use the `theme()` helper function to the docs
2 parents 341768c + caed2c1 commit d806948

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,29 @@ module.exports = {
134134
}
135135
```
136136

137+
Like with all theme customizations in Tailwind, you can also define the `typography` key as a function if you need access to the `theme` helper:
138+
139+
```js
140+
// tailwind.config.js
141+
module.exports = {
142+
theme: {
143+
typography: (theme) => ({
144+
default: {
145+
css: {
146+
color: theme('colors.gray.800'),
147+
148+
// ...
149+
}
150+
}
151+
})
152+
},
153+
plugins: [
154+
require('@tailwindcss/typography'),
155+
// ...
156+
],
157+
}
158+
```
159+
137160
Customizations should be applied to a specific modifier like `default` or `xl`, and must be added under the `css` property. Customizations are authored in the same [CSS-in-JS syntax](https://tailwindcss.com/docs/plugins#css-in-js-syntax) used to write Tailwind plugins.
138161

139162
It's important to note that all customizations are **merged** with the defaults. If you'd like to completely override a provided size modifier, you can do so by disabling that modifier so the default styles are not included.

0 commit comments

Comments
 (0)