tailwind newly added spacing overrides the defaults

I just added this custom spacing to tailwind: spacing: {main: '10%'} and other spacings eg.py-4 stopped working.
2 Replies
andersgee
andersgee3y ago
You probably replaced the defaults, you can keep them around like this:
const { spacing } = require("tailwindcss/defaultTheme");

...
theme: {
...
extend: {
spacing: { main: "10%", ...spacing },
const { spacing } = require("tailwindcss/defaultTheme");

...
theme: {
...
extend: {
spacing: { main: "10%", ...spacing },
venego
venegoOP3y ago
yes I did. I did not put that in extend. thanks

Did you find this page helpful?