404 page with tailwind css #28883
-
I'm using Gatsby with Tailwind CSS. I'm having a problem where the Tailwind styles are being applied to the development 404 page: As you can see, the problem is that Tailwind removes all of the default styles. Headings, buttons, and paragraphs all look the same. The tailwind styles are applied in
It doesn't matter if I rename the css file. The development 404 page applies whatever styles I have imported in Is there any to prevent these Tailwind styles from being applied to the development 404 page? It's not such a big deal, but it would be nice to make it a little prettier. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
That page is not the default 404 page.. Click on the "Preview custom 404 page". |
Beta Was this translation helpful? Give feedback.
-
FYI to disable the dev 404 completely you can do this in exports.onCreatePage = ({ page, actions: { deletePage } }) => {
if (page.path === '/dev-404-page/') {
deletePage(page)
}
} |
Beta Was this translation helpful? Give feedback.
-
And just found you can make your own page to override it.
I copy pasted the default and made it work with tailwind. https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/dev-404-page/raw_dev-404-page.js |
Beta Was this translation helpful? Give feedback.
-
For me, I just tried to style back the elements used on the page. I choose tailwind classes that will style them close to the default style. Here is my
|
Beta Was this translation helpful? Give feedback.
And just found you can make your own page to override it.
pages/dev-404-page.tsx
.I copy pasted the default and made it work with tailwind. https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/dev-404-page/raw_dev-404-page.js