gulp-postcss | Pipe CSS through PostCSS processors with a single parse | Plugin library
kandi X-RAY | gulp-postcss Summary
kandi X-RAY | gulp-postcss Summary
PostCSS gulp plugin to pipe CSS through several plugins, but parse CSS only once.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- returns a loader with plugins
- handle CSS source map
gulp-postcss Key Features
gulp-postcss Examples and Code Snippets
npm install postcss-visitor --save-dev
require('postcss-visitor').process(YOUR_CSS, /* options, plugins, visitors */)
npm install postcss --save-dev
postcss([
require('postcss-visitor')(/* options, plugins, visitors */)
]).process(YOUR_CSS, /* op
const gulp = require('gulp')
const postcss = require('gulp-postcss')
const removeStyle = require('postcss-remove-style')({
'*': ['color'], // 删除所有样式里的color属性
'.b': '*' // 删除.b类
'.c': ['font'] // 删除.c里的font属性
})
gulp.task('test', f
npm i --save-dev gulp-postcss autoprefixer cssnano
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
//var autoprefixer = require('gulp-autoprefixer'); /*remove*/
//var
Community Discussions
Trending Discussions on gulp-postcss
QUESTION
After changing gulp 3 to 4 I receive the error when I try to run gulp build
:
ANSWER
Answered 2021-Nov-29 at 16:38In copy:css
you have this line:
paths.src.base + '/assets/css/argon.css'
where apparently your error is. The problem is your paths.src.base
is defined as
base: './'
to which you are adding /assets/css/argon.css
so you end up with
.//assets/css/argon.css
note the two leading backslashes.
Get rid of the leading backslash in the /assets/...
and check the rest of your code for the same problem.
Also since you are using gulp4 get rid of runSequence
- look at the documentation for gulp.series
.
QUESTION
I am a beginner to Javascript and Gulp. Am learning this based on a udemy course in which Gulp 3 is being used, and I've been looking at docs to convert the code to Gulp 4. It's been fun so far since I am learning more when I am doing the conversions myself, but am stuck on this one. Wonder if you guys can offer some advice.
Issue: When I split the gulpfile.js into separate files to organise my files better, it starts throwing errors. Code below.
styles.js
...ANSWER
Answered 2021-Aug-30 at 17:22I have a full article that shows many how to regarding going from gulp3 to gulp4, I think you are going to find everything you need there
But basically, I think you need to take a look at these modules :
Then, from a gulp.js perspective, you can end up with something like this :
QUESTION
I'm having an issue converting my postcss conditionals to css. I'm using gulp to process the files and output a css file. Everything seems to be working up until the point that I try to convert the conditionals (see below).
Here is my gulp file:
...ANSWER
Answered 2021-Aug-12 at 07:50maybe there is some way to process the plugins in two passes? E.g. first ['postcss-import', 'postcss-mixins']
, then the rest? That would at least (dis)prove your theory
QUESTION
I'm trying to:
- Add vendor prefixes to SCSS
- Compile to CSS
- Minify it
With this gulp code:
...ANSWER
Answered 2021-Jul-09 at 12:46This
QUESTION
Just went back to a very old project and updated to Gulp 4.0.2.
Managed to get it watching and compiling css, but doesn't seem to watch changes to the JavaScript files?
It doesn't throw any errors, just doesn't compile the JS when I make a change.
(I'm a designer and my JS is terrible, so you might have to really spell it out for me 😬)
gulpfile.js
...ANSWER
Answered 2021-Jan-05 at 09:24paths.scripts.src + '/*.js'
and paths.vendor.src + '/*.js'
contained an extra /
Thanks to Thomas Sablik
QUESTION
I'm new to gulp
tasks. I'm practicing it now. After some googling I learned to write few tasks. I'm using tailwind
and bulma
css in my project.
Here is my setup.
package.json
:
ANSWER
Answered 2020-Nov-29 at 19:07After some googling and research, here is how I fixed it.
added gulp-sass
by doing npm install gulp-sass
and piped gulp-sass
in my gulp task.
Here is my final working setup,
package.json
:
QUESTION
So, I am new to js development. What I am trying to do is to set up a basic environment to study and to be kind of a bootstrap, with gulp tasks and so on.
I'm stuck in this error thrown in the terminal:
...ANSWER
Answered 2020-Oct-01 at 04:46you don't seem to have a gulp run script in your package.json also you want to remove "type": "module" from package.json which is causing the issue with require/esm.
here are my edits to your package.json file
QUESTION
I have a bit of a strange issue that I'm hoping I can get some help with.
I've got a WordPress theme that I've been developing using a dev setup including gulp & babel. I have a hosting provider with a development environment, and production environment. Up until now, I have had no issues building the theme, uploading it to the dev environment and testing it - it's all been pretty smooth.
Now I'm trying to upload the same theme (I'm talking exactly the same), to the production site, instead of the development site, and I get the following error in the console:
...ANSWER
Answered 2020-Jul-16 at 10:18For anyone who stumbles across this issue in the future (probably unlikely).
It turns out the culprit was the CDN being used in our production environment. I figured out that the bundle.js file I was uploading wasn't the same as was being served up in the site, and turned the CDN off which seemed to fix the issue. :/
QUESTION
I am trying to use new features in SCSS. And i get error when I use @use, @debug
Error:
...ANSWER
Answered 2020-Jun-12 at 16:53@use is not supported in node-sass yet. You have to use @import
instead. Currently only dart-sass supports @use.
QUESTION
I don't even know how to explain my problem shortly in title. I want to create task which will follow these steps:
- Take Sass File as a source (Ex. src/scss/main.scss)
- Sort css properties with 'postcss-sorting'
- Overwrite source file to same path (Ex. src/scss/main.scss)
- Take sorted scss file and compile to css
- Write to css folder (Ex. dist/css)
I try to write this task but when i start to watch scss file changes, task having infinite loop. I tried with 2 different tasks too (one for sort css properties and write file, other one for compile and write) it still looping. I don't want to sort only css properties in css file, i want to sort my scss file too. That is my example code:
...ANSWER
Answered 2020-May-09 at 20:10You can use gulp-changed, it will override the file only if there is a change, preventing the infinite loop:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gulp-postcss
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page