projecte_ionic/node_modules/postcss-double-position-gradients
2022-02-09 18:30:03 +01:00
..
node_modules Conexio amb la api 2022-02-09 18:30:03 +01:00
CHANGELOG.md Conexio amb la api 2022-02-09 18:30:03 +01:00
index.cjs.js Conexio amb la api 2022-02-09 18:30:03 +01:00
index.cjs.js.map Conexio amb la api 2022-02-09 18:30:03 +01:00
index.es.mjs Conexio amb la api 2022-02-09 18:30:03 +01:00
index.es.mjs.map Conexio amb la api 2022-02-09 18:30:03 +01:00
LICENSE.md Conexio amb la api 2022-02-09 18:30:03 +01:00
package.json Conexio amb la api 2022-02-09 18:30:03 +01:00
README.md Conexio amb la api 2022-02-09 18:30:03 +01:00

PostCSS Double Position Gradients PostCSS

NPM Version Build Status Support Chat

PostCSS Double Position Gradients lets you use double-position gradients in CSS, following the CSS Image Values and Replaced Content specification.

.linear-gradient {
  background-image: linear-gradient(90deg, black 25% 50%, blue 50% 75%);
}

.conic-gradient {
  background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
}

/* becomes */

.linear-gradient {
  background-image: linear-gradient(90deg, black 25%, black 50%, blue 50%, blue 75%);
  background-image: linear-gradient(90deg, black 25% 50%, blue 50% 75%);
}

.conic-gradient {
  background-image: conic-gradient(yellowgreen 40%, gold 0deg, gold 75%, #f06 0deg);
  background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
}

Usage

Add PostCSS Double Position Gradients to your project:

npm install postcss-double-position-gradients --save-dev

Use PostCSS Double Position Gradients to process your CSS:

const postcssDoublePositionGradients = require('postcss-double-position-gradients');

postcssDoublePositionGradients.process(YOUR_CSS /*, processOptions, pluginOptions */);

Or use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssDoublePositionGradients = require('postcss-double-position-gradients');

postcss([
  postcssDoublePositionGradients(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

PostCSS Double Position Gradients runs in all Node environments, with special instructions for:

Node PostCSS CLI Webpack Create React App Gulp Grunt

Options

preserve

The preserve option determines whether the original double-position gradients should be preserved. By default, double-position gradients are preserved.

postcssDoublePositionGradients({ preserve: false })
.linear-gradient {
  background-image: linear-gradient(90deg, black 25% 50%, blue 50% 75%);
}

.conic-gradient {
  background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
}

/* becomes */

.linear-gradient {
  background-image: linear-gradient(90deg, black 25%, black 50%, blue 50%, blue 75%);
}

.conic-gradient {
  background-image: conic-gradient(yellowgreen 40%, gold 0deg, gold 75%, #f06 0deg);
}