OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Next Ui Tailwind Custom Prefix

  • Thread starter Thread starter Mazumder
  • Start date Start date
M

Mazumder

Guest
How can I apply custom PREFIX to Next UI library alongside Tailwind CSS? While it works seamlessly with Tailwind CSS, the issue arises with Next UI components as they use regular classes without a prefix. Is there a way to make Next UI components use the "tw-" prefix in their CSS, as defined in my tailwind.config.js file?

Code:
   const { nextui } = require("@nextui-org/react");

module.exports = {
  prefix: "tw-",
  important: true,
  content: ["./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"],
  presets: [],
  darkMode: "class", // or 'media'
  theme: {},
  plugins: [
    require("@tailwindcss/typography"),
    require("@tailwindcss/line-clamp"),
    nextui({
      prefix: "tw-",
    }),
  ],
  corePlugins: {
    preflight: false,
  },
};

<p>How can I apply custom PREFIX to Next UI library alongside Tailwind CSS? While it works seamlessly with Tailwind CSS, the issue arises with Next UI components as they use regular classes without a prefix. Is there a way to make Next UI components use the "tw-" prefix in their CSS, as defined in my tailwind.config.js file?</p>
<pre><code> const { nextui } = require("@nextui-org/react");

module.exports = {
prefix: "tw-",
important: true,
content: ["./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"],
presets: [],
darkMode: "class", // or 'media'
theme: {},
plugins: [
require("@tailwindcss/typography"),
require("@tailwindcss/line-clamp"),
nextui({
prefix: "tw-",
}),
],
corePlugins: {
preflight: false,
},
};
</code></pre>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top