'Can't Use Default Spacing Options on Tailwind

I've just started a new project in Laravel but I'm having issues with Tailwind. I can't use all margin or padding spacing options like m-5, p-4 or mb-4 and so on... Weird thing is I can use mt-5 but can't use m-5.

When I create a new project, it comes with Tailwind CSS. I also tried with npm installation with npm install -D tailwindcss@latest postcss@latest autoprefixer@latest but nothing changed.

Checkout this image: screenshot.

How can I fix this issue?



Solution 1:[1]

I don't think remove mode: 'jit' is a good idea. alternate for dev mode you can whitelist all class like this:

$ npm install dotenv --save

ADD this line and code to your tailwind.config.js:

require('dotenv').config();

Define PURGE variable in .env

safelist: process.env.PURGE === "development" ? [{ pattern: /.*/ }] : []

Here is full article about it. https://github.com/tailwindlabs/tailwindcss/discussions/6557

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fred