Giter Club home page Giter Club logo

quasar-tailwind-conflicts's Introduction

Quasar / TailwindUI conflicts

How Tailwind UI dropdown component looks on Quasar:

100039916-3c0a6c00-2e41-11eb-9ea7-2005979180b2

How it looks on a Vue CLI app:

100039908-357bf480-2e41-11eb-97b7-515d4fbdf39e

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"),
  ]
}

Install the dependencies

yarn install

Comment the Quasar stylesheet file

In node_modules/@quasar/app/templates/entry/client-entry.js

// We load Quasar stylesheet file
//import 'quasar/dist/quasar.<%= __css.quasarSrcExt %>'

Start the app

quasar dev

quasar-tailwind-conflicts's People

Contributors

jlntrrl-agoravita avatar juterral avatar

Watchers

 avatar

Forkers

hawkeye64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.