How Tailwind UI dropdown component looks on Quasar:
How it looks on a Vue CLI app:
I've made some changes in the .postcssrc.js
file to remove most TailwindCSS conflicts (based on this comment from the original issue but already tried this one too )
// https://github.com/michael-ciniawsky/postcss-load-config
// These are the conflicting classes between Quasar and Tailwind. They may change in the future.
const conflictingClasses = [
// flex must be treated separately
"order-first", "order-last", "cursor-not-alowed",
"cursor-pointer", "block", "inline-block", "text-justify",
"hidden", "invisible", "overflow-auto", "overflow-hidden"
];
// The plugin takes an object where the keys are the selectors and the values are the properties (or list of properties) to remove or all properties with "*".
const removeObj = {
...Object.fromEntries(conflictingClasses.map(cc => [`.${cc}`, "*"])), // Removes all properties from conflicting classes
".row, .column, .flex": "flex-wrap" // Turns out rules defining multiple classes must be targetted as a whole.
};
module.exports = {
plugins: [
// to edit target browsers: use "browserslist" field in package.json
require("postcss-remove-declaration")({ remove: removeObj }), // The plugin must be placed before Tailwind import!
require("tailwindcss"),
require("autoprefixer"),
]
}
yarn install
In node_modules/@quasar/app/templates/entry/client-entry.js
// We load Quasar stylesheet file
//import 'quasar/dist/quasar.<%= __css.quasarSrcExt %>'
quasar dev