0

I installed tailwindcss following this tutorial: https://tailwindcss.com/docs/guides/create-react-app (using Craco instead of postcss). After I included every code snippet and reloaded the webpage, all the default CSS styles were gone (h1, flex, etc.) Is it because I didn't configure tailwindcss with the whole project right or it's normal to have all the default styling rules deleted and you have to specify the base. By configuring I mean you just need to add:

@tailwind base;
@tailwind components;
@tailwind utilities;

in index.css file only, not every .css component file.

1
  • Tailwind set it's own base styles. So you`ve done everything right. More information can be found here - tailwindcss.com/docs/preflight Commented Jan 18, 2021 at 21:56

1 Answer 1

2

Tailwind Preflight removes all of the default margins from elements like headings, blockquotes, paragraphs, etc.

@tailwind base; /* Preflight will be injected here */

@tailwind components;

@tailwind utilities;

If you would like to stick with default values, then you can disable Preflight

  // tailwind.config.js
  module.exports = {
    corePlugins: {
     preflight: false,
    }
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.