パッケージの詳細

precsss

cage1618375CC0-1.04.0.2

Use Sass-like markup and staged CSS features in CSS

postcss, css, postcss-plugin, sass

readme

!!! This project is a replica of PreCSSS, because PreCSSS is no longer maintained !!!.

PreCSSS PostCSS Logo

NPM Version Build Status Support Chat

PreCSSS 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;
}

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

Usage

Add PreCSSS to your build tool:

npm install PreCSSSs --save-dev

or

yarn add -D PreCSSSs

Node

Use PreCSSS to process your CSS:

import PreCSSS from 'PreCSSS';

PreCSSS.process(YOUR_CSS);

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Use PreCSSS as a plugin:

import postcss from 'postcss';
import PreCSSS from 'PreCSSS';

postcss([
  PreCSSS(/* options */)
]).process(YOUR_CSS);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Use PreCSSS in your Gulpfile:

import postcss from 'gulp-postcss';
import PreCSSS from 'PreCSSS';

gulp.task('css', function () {
  return gulp.src('./src/*.css').pipe(
    postcss([
      PreCSSS(/* options */)
    ])
  ).pipe(
    gulp.dest('.')
  );
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Use PreCSSS in your Gruntfile:

import PreCSSS from 'PreCSSS';

grunt.loadNpmTasks('grunt-postcss');

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

Plugins

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

更新履歴

Changes to PreCSS

4.0.0 (November 23, 2018)

  • Updated: postcss to 7.0.6 (major)
  • Updated: postcss-advanced-variables to 3.0.0 (major)
  • Updated: postcss-extend-rule to 2.0.0 (major)
  • Updated: postcss-nested to 4.1.0 (major)
  • Updated: postcss-preset-env to 6.4.0 (major)

3.1.2 (February 27, 2018)

  • Updated: postcss-advanced-variables to 2.3.3 (patch)
  • Updated: postcss-preset-env to 3.2.2 (patch)

3.1.1 (February 21, 2018)

  • Updated: Dependencies to latest working release (no major bumps)

3.1.0 (Janaury 22, 2018)

  • Updated: PostCSS Preset Env 2.1 (major)

3.0.0 (Janaury 16, 2018)

  • Changed: Using PostCSS Advanced Variables instead of the following;
    • PostCSS Import
    • PostCSS Mixins
  • Changed: Using PostCSS Preset Env instead of the following;
    • PostCSS Color Function
    • PostCSS Custom Media
    • PostCSS Custom Properties
    • PostCSS Custom Selectors
    • PostCSS Media MinMax
    • PostCSS Nesting
    • PostCSS Selector Matches
    • PostCSS Selector Not
  • Changed: Using PostCSS Extend Rule instead of PostCSS Extend
  • Updated: PostCSS Advanced Variables 2.3 (major)
  • Updated: PostCSS Property Lookup 2.0 (major)
  • Updated: PostCSS Nested 3.0 (major)

2.0.0 (January 6, 2018)

  • Updated: PostCSS 6 (major)
  • Updated: Plugin organization

1.4.0 (October 24, 2015)

  • Added: PostCSS At-Root 0.1.2
  • Added: PostCSS Property Lookup 1.1.3
  • Updated: Tests and documentation

1.3.0 (October 21, 2015)

  • Updated: PostCSS 5.0.10 (patch)
  • Updated: PostCSS Advanced Variables 1.2.2 (minor)
  • Updated: PostCSS Extend 1.0.1 (minor)
  • Updated: PostCSS Mixins 2.1.0 (major)
  • Updated: PostCSS Nesting 2.0.6 (patch)
  • Updated: Tests and documentation

1.2.3 (September 24, 2015)

  • Updated: Move selectors after nesting

1.2.2 (September 24, 2015)

  • Updated: package.json to spaces

1.2.1 (September 24, 2015)

  • Updated: Plugin ordering

1.2.0 (September 24, 2015)

  • Added: PostCSS Nesting 2.0.4
  • Added: Tests for @nest
  • Updated: PostCSS 5.0.6
  • Updated: PostCSS Mixins 1.0.1
  • Deprecated: PostCSS Nesting 2.0.4

1.1.3 (September 14, 2015)

  • Updated: PostCSS 5.0.5
  • Updated: PostCSS Partial Import 1.3.0

1.1.2 (September 08, 2015)

  • Updated: PostCSS Partial Import 1.1.1

1.1.1 (September 08, 2015)

  • Updated: PostCSS Extend 1.1.0

1.1.0 (September 08, 2015)

  • Added: PostCSS Extend
  • Added: PostCSS Partial Import
  • Added: PostCSS W3C Custom Media
  • Added: PostCSS W3C Custom Properties
  • Added: PostCSS W3C Custom Selectors
  • Added: PostCSS W3C Multiple Matches
  • Added: PostCSS W3C Multiple Nots
  • Updated: PostCSS Media Minmax 2.1.0
  • Updated: Documentation
  • Removed: PostCSS Import
  • Removed: PostCSS Sass Extend

1.0.0 (September 07, 2015)

  • Updated: PostCSS 5.0.4
  • Updated: PostCSS Advanced Variables 1.0.0
  • Updated: PostCSS Color Function 2.0.0
  • Updated: PostCSS Import 7.0.0
  • Updated: PostCSS Media Minmax 2.0.0
  • Updated: PostCSS Mixins 1.0.0
  • Updated: PostCSS Nested 1.0.0
  • Updated: PostCSS Simple Extend 1.0.0
  • Updated: ESLint 1.0.0
  • Removed: PostCSS Simple Vars
  • Removed: PostCSS process method which is now in core

0.3.0 (July 22, 2015)

  • Added: postcss-advanced-variables support for vars in @media
  • Added: postcss-import skipDuplicates option to allows you to not skip duplicated files
  • Added: postcss-mixins mixinsFiles option.
  • Updated: other plugins without notable changes

0.2.2 (July 10, 2015)

  • Updated: Documentation

0.2.1 (July 10, 2015)

  • Added: Switch from postcss-sass-extend to postcss-simple-extend

0.1.3 (July 08, 2015)

  • Added: Support for @else statements
  • Updated: Dependencies

0.1.2 (July 08, 2015)

  • Updated: Tests to support nested options

0.1.1 (July 08, 2015)

  • Fixed: Re-ordered plugins so they don’t break each other
  • Changed: Plugin option namespaces
  • Removed: Unnecessary default options

0.1.0 (July 08, 2015)

  • Changed: Named project precss

0.0.2 (July 07, 2015)

  • Updated: Swapped conditional, for, and each for advanced-variables

0.0.1 (July 06, 2015)

Pre-release