0👍
✅
PostCSS error
Vue CLI scaffolded projects already include PostCSS (including postcss
, postcss-calc
, and postcss-loader
), so you don’t need to install it in your project. The only dependency needed here is postcss-custom-properties
.
To resolve the PostCSS error, you should uninstall the PostCSS dependencies that you had mistakenly added:
npm uninstall --save-dev postcss postcss-calc postcss-loader
Starting from scratch
To setup custom colors for FullCalendar in a Vue CLI scaffolded project:
-
Install
postcss-custom-properties
with:npm install --save-dev postcss-custom-properties
-
Create
postcss.config.js
with the following PostCSS configuration:// <projectRoot>/postcss.config.js module.exports = { plugins: [ require("postcss-custom-properties")({ preserve: false, importFrom: [ "client/fullcalendar-vars.css", ], }), require("postcss-calc"), ], }
-
Create
fullcalendar-vars.css
with the following CSS:/* <projectRoot>/client/fullcalendar-vars.css */ :root { --fc-border-color: green; --fc-button-text-color: #ff0000; }
Note: Changes to this file are not hot-reloaded, so the dev server must be restarted to reflect any updates.
-
Start the Vue CLI dev server with:
npm run serve
Source:stackexchange.com