Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 29, 2024. It is now read-only.
/precssPublic archive

Use Sass-like markup in your CSS

License

NotificationsYou must be signed in to change notification settings

csstools/precss

NPM VersionBuild StatusSupport Chat

PreCSS lets you use Sass-like markup and staged CSS features in CSS.

$blue:#056ef0;$column:200px;.menu {width:calc(4*$column);}.menu_link {background:$blue;width:$column;}/* becomes*/.menu {width:calc(4*200px);}.menu_link {background:#056ef0;width:200px;}

PreCSS combines Sass-like syntactical sugar — like variables, conditionals, anditerators — with emerging CSS features — like logical and custom properties,media query ranges, and image sets.

Usage

AddPreCSS to your build tool:

npm install precss --save-dev

Node

UsePreCSS to process your CSS:

importprecssfrom'precss';precss.process(YOUR_CSS);

PostCSS

AddPostCSS to your build tool:

npm install postcss --save-dev

UsePreCSS as a plugin:

importpostcssfrom'postcss';importprecssfrom'precss';postcss([precss(/* options */)]).process(YOUR_CSS);

Gulp

AddGulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

UsePreCSS in your Gulpfile:

importpostcssfrom'gulp-postcss';importprecssfrom'precss';gulp.task('css',function(){returngulp.src('./src/*.css').pipe(postcss([precss(/* options */)])).pipe(gulp.dest('.'));});

Grunt

AddGrunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

UsePreCSS in your Gruntfile:

importprecssfrom'precss';grunt.loadNpmTasks('grunt-postcss');grunt.initConfig({postcss:{options:{use:[precss(/* options */)]},dist:{src:'*.css'}}});

Plugins

PreCSS is powered by the following plugins (in this order):

About

Use Sass-like markup in your CSS

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp