Tailwind not working with vue #1666
Replies: 11 comments 27 replies
-
I'm not sure if you can import your styles into |
Beta Was this translation helpful? Give feedback.
-
Is it possible purge-css is purging your
Probably not the right solution - I'm planning on revisiting after I upgrade to 1.4 today and remove |
Beta Was this translation helpful? Give feedback.
-
I am having the same problem here.
// tailwind.config.js
module.exports = {
purge: {
content: ['./public/**/*.html', './src/**/*.vue'],
options: {
whitelistPatterns: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!(|.*?:)cursor-move).+-move$/,
/^router-link(|-exact)-active$/,
/tooltip/,
/popover/,
/notification/,
],
}
},
// ...
}
Now all my style is removed, there's litterally nothing applied. I am sure the file is imported, as when I write I am using Vue in dev mode, with their development server. I unfortunately cannot share the repository, I'll try to create one though. |
Beta Was this translation helpful? Give feedback.
-
just run these two commands and your are good to go postcss 8 is new so rolling back to postcss 7 for a while. once the issue with postcss 8 is resolved by tailwind dev team then you can upgrade to postcss by these commands npm uninstall tailwindcss @tailwindcss/postcss7-compat |
Beta Was this translation helpful? Give feedback.
-
I've got the same issue using this starter template: https://github.com/kefranabg/bento-starter I've tried all of the steps in this thread including the postcss 7 rollback, using in App.vue vs. main.js. No TailwindCSS is rendered in the project. If I start a new project with Vue 3 + Vite using the docs it works. But I'm already down the road on this project using the bento starter. edit: is there any debug log and I share to determine where the breakdown is? |
Beta Was this translation helpful? Give feedback.
-
Replace this code with your postcss.config.jsmodule.exports = () => {
return {
postcssPlugin: 'postcss-will-change',
Declaration: {
'will-change': (decl, { Declaration }) => {
decl.cloneBefore(
new Declaration({ prop: 'backface-visibility', value: 'hidden' })
)
}
}
}
}
module.exports.postcss = true |
Beta Was this translation helpful? Give feedback.
-
The docs are quite solid for installing Vue + Tailwind. |
Beta Was this translation helpful? Give feedback.
-
The most issue programmer faced I think they didn't read carefully documentation and search about the specific using of tailwind with witch framework does it apply ,the will save there time when they apply the tips mentions on . |
Beta Was this translation helpful? Give feedback.
-
I tried solutions above to no success. I followed this one. Technically, you have to create module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer')
]
} "vue": "^2.7.14",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.21",
"tailwindcss": "^3.2.4", |
Beta Was this translation helpful? Give feedback.
-
Thanks
…On Sun, 8 Jan 2023, 8:07 am Ernie Jeash Villahermosa, < ***@***.***> wrote:
I followed this one <https://morioh.com/p/b1c3d288fcde>.
Technically, you have to create postcss.config.js
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer')
]}
"vue": "^2.7.14","autoprefixer": "^10.4.13","postcss": "^8.4.21","tailwindcss": "^3.2.4",
—
Reply to this email directly, view it on GitHub
<#1666 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMTWY6PD7WMB4XVKZWH5NBTWRJRSZANCNFSM4MVQVA3A>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
https://tailwindcss.com/docs/guides/vite#vue - Following this solved my issue. I was missing .{vue} from the tailwind.config.js content property
Adding .vue extension solved it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
i installed tailwindcss into a vuejs SPA did all the setup
create a assets/css/tailwind.css and added the necessary base styles
imported it in the main.js file
create a postcss.config.js file and copied the required configuration from the official documentation
but the tailwind styles don't apply to my markups
inside the tailwind.css
`@tailwind base;
@tailwind components;
@tailwind utilities;
`
inside the postcss.config.js
module.exports = { plugins: [ // ... require("tailwindcss"), require("autoprefixer"), // ... ], }
inside the main.js file
import Vue from "vue" import App from "./App.vue" import "./registerServiceWorker" import router from "./router" import store from "./store" import axios from "axios" import "./assets/css/tailwind.css" import firebase from "firebase/app" import "firebase/firestore" import "firebase/auth"
The package.json file
"dependencies": { "autoprefixer": "^9.7.6", "axios": "^0.19.2", "core-js": "^3.6.4", "firebase": "^7.14.2", "register-service-worker": "^1.7.1", "tailwindcss": "^1.4.0", "vue": "^2.6.11", "vue-router": "^3.1.6", "vuex": "^3.1.3" },
I don't know what am doing wrong
Beta Was this translation helpful? Give feedback.
All reactions