K
K
kq19952020-12-29 10:14:27
Web development
kq1995, 2020-12-29 10:14:27

How to use preprocessors other than SCSS and SASS?

Can you please tell me how to use a preprocessor other than SASS or SCSS? With these two, it's easy. there is a GUI app for Windows, which will automatically compile everything, where everything is clear, etc.

But if I want to use PostCSS, then it won't work. We need (as for me) long dances with a tambourine.
Can you explain how it can be done "easily"?

I use Webstorm, but when creating .pcss files, they are not compiled, although the plugin is installed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hellcaster, 2020-12-29
@web_Developer_Victor

GUI for beginners (I myself once used Koala). All true programmers use the CLI. Today, it's best to set up Gulp or WebPack to build the project, which will immediately compile the preprocessor code to pure CSS.
They have many advantages:

  • Customization
  • Management from the command line (no need to switch between windows, but immediately launched in WebStorm and you can watch the entire log)
  • Lightweight (does not consume a lot of PC resources)

These tools not only compile PostCSS, they can optimize images, HTML, CSS, JS, compile everything into one file, embed svg into html, and much more.

S
Sergey delphinpro, 2020-12-29
@delphinpro

What dances with a tambourine?

  1. Install nodejs on machine
  2. Write gulpfile.js
  3. Install packages
  4. Start using.

The hardest part here (but not hard in general) is writing the gulpfile.
Sample task for compiling sass
import gulp from 'gulp';
import gulpSass from 'gulp-sass';

export const sass = function(){
  return gulp.src('./src/sass/*.scss')
    .pipe(gulpSass())
    .pipe(gulp.dest('./dis/css/'));
}

Run
npm run sass
And get the compiled file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question