Thursday, June 2, 2022
HomeWordPress DevelopmentHow you can arrange Tailwind with Subsequent.js

How you can arrange Tailwind with Subsequent.js


Tailwind is a utility-first CSS framework.
This text describes the way to arrange Tailwind with Subsequent.js.



Set up

npm i --save-dev tailwindcss
npm i --save-dev postcss
npm i --save-dev autoprefixer
Enter fullscreen mode

Exit fullscreen mode



Init

npx tailwindcss init -p
Enter fullscreen mode

Exit fullscreen mode



Setting

// tailwind.config.js

module.exports = {
  content material: ["./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    prolong: {},
  },
  plugins: [],
};
Enter fullscreen mode

Exit fullscreen mode



Write

/* src/types/globals.css */

@tailwind base;
@tailwind parts;
@tailwind utilities;
Enter fullscreen mode

Exit fullscreen mode



Utilizing Tailwind in Web page

// src/pages/instance.tsx

const Web page = (): JSX.Aspect => {
  return (
    <p data-testid="textual content" className="underline">
      Howdy
    </p>
  );
};

export default Web page;
Enter fullscreen mode

Exit fullscreen mode



Test

npm run dev
Enter fullscreen mode

Exit fullscreen mode

http://localhost:3000/instance



Assist for Visible Studio Code

// .vscode/extensions.json

{
  "suggestions": ["bradlc.vscode-tailwindcss"]
}
Enter fullscreen mode

Exit fullscreen mode



Assist for ESLint

npm i --save-dev eslint-plugin-tailwindcss
Enter fullscreen mode

Exit fullscreen mode

// .eslintrc.json

{
  "extends": [
    // ...
    "plugin:tailwindcss/recommended"
  ],
  // ...
}
Enter fullscreen mode

Exit fullscreen mode

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments