Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
10a32ae
WIP
Antonio-Laguna Apr 30, 2022
7378594
Fixing tests and TypeScript node conversion
Antonio-Laguna Apr 30, 2022
9fb728d
Adding round & more tests
Antonio-Laguna Apr 30, 2022
02379a2
Update plugins/postcss-stepped-value-functions/src/mod.ts
Antonio-Laguna May 1, 2022
06e7c26
Update plugins/postcss-stepped-value-functions/src/rem.ts
Antonio-Laguna May 1, 2022
d100775
Update plugins/postcss-stepped-value-functions/src/round.ts
Antonio-Laguna May 1, 2022
06effc5
Update plugins/postcss-stepped-value-functions/src/utils.ts
Antonio-Laguna May 1, 2022
84edcb0
Updating docs and examples
Antonio-Laguna May 1, 2022
19215e3
Ensuring values are there on mod
Antonio-Laguna May 1, 2022
566d718
More tests
Antonio-Laguna May 1, 2022
073640a
More complex
Antonio-Laguna May 1, 2022
3c84d99
Somewhat legit but broken
Antonio-Laguna May 1, 2022
c75c6af
Merge branch 'main' into feature/stepped-value-functions
Antonio-Laguna May 1, 2022
3e4b9f3
Linting
Antonio-Laguna May 1, 2022
81630fe
Linking to CSSDB
Antonio-Laguna May 1, 2022
ea6287c
Updating labeler
Antonio-Laguna May 1, 2022
07c7e4f
Updating meta
Antonio-Laguna May 1, 2022
3913df3
Sorting this too
Antonio-Laguna May 1, 2022
db00658
Update plugins/postcss-stepped-value-functions/docs/README.md
Antonio-Laguna May 2, 2022
bf5dcc6
Update plugins/postcss-stepped-value-functions/package.json
Antonio-Laguna May 2, 2022
622a4c1
Update plugins/postcss-stepped-value-functions/docs/README.md
Antonio-Laguna May 2, 2022
7995c8a
Regenerating docs
Antonio-Laguna May 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,9 @@
- plugins/postcss-unset-value/**
- experimental/postcss-unset-value/**

"plugins/postcss-stepped-value-functions":
- plugins/postcss-stepped-value-functions/**
- experimental/postcss-stepped-value-functions/**

"sites/postcss-preset-env":
- sites/postcss-preset-env/**
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion plugins/postcss-base-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
"name": "@csstools/postcss-base-plugin",
"description": "A base plugin",
"version": "0.0.0",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"contributors": [
{
"name": "Antonio Laguna",
"email": "antonio@laguna.es",
"url": "https://antonio.laguna.es"
},
{
"name": "Romain Menke ",
"email": "romainmenke@gmail.com"
}
],
"license": "CC0-1.0",
"funding": {
"type": "opencollective",
Expand Down
6 changes: 6 additions & 0 deletions plugins/postcss-stepped-value-functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
yarn.lock
*.result.css
*.result.css.map
dist/*
1 change: 1 addition & 0 deletions plugins/postcss-stepped-value-functions/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.1
30 changes: 30 additions & 0 deletions plugins/postcss-stepped-value-functions/.tape.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import postcssTape from '../../packages/postcss-tape/dist/index.mjs';
import plugin from '@csstools/postcss-stepped-value-functions';

postcssTape(plugin)({
basic: {
message: "supports basic usage",
},
'basic:on-invalid-warn': {
message: 'supports { onInvalid: "warn" } usage',
options: {
onInvalid: 'warn'
},
warnings: 17,
},
'basic:preserve-true': {
message: 'supports { preserve: true } usage',
options: {
preserve: true
},
},
'examples/example': {
message: 'minimal example',
},
'examples/example:preserve-true': {
message: 'minimal example',
options: {
preserve: true
}
}
});
5 changes: 5 additions & 0 deletions plugins/postcss-stepped-value-functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changes to PostCSS Stepped Value Functions

### 1.0.0 (Unreleased)

- Initial version
176 changes: 176 additions & 0 deletions plugins/postcss-stepped-value-functions/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Installing PostCSS Stepped Value Functions

[PostCSS Stepped Value Functions] runs in all Node environments, with special instructions for:

| [Node](#node) | [PostCSS CLI](#postcss-cli) | [Webpack](#webpack) | [Create React App](#create-react-app) | [Gulp](#gulp) | [Grunt](#grunt) |
| --- | --- | --- | --- | --- | --- |

## Node

Add [PostCSS Stepped Value Functions] to your project:

```bash
npm install postcss @csstools/postcss-stepped-value-functions --save-dev
```

Use it as a [PostCSS] plugin:

```js
const postcss = require('postcss');
const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');

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

## PostCSS CLI

Add [PostCSS CLI] to your project:

```bash
npm install postcss-cli @csstools/postcss-stepped-value-functions --save-dev
```

Use [PostCSS Stepped Value Functions] in your `postcss.config.js` configuration file:

```js
const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');

module.exports = {
plugins: [
postcssSteppedValueFunctions(/* pluginOptions */)
]
}
```

## Webpack

_Webpack version 5_

Add [PostCSS Loader] to your project:

```bash
npm install postcss-loader @csstools/postcss-stepped-value-functions --save-dev
```

Use [PostCSS Stepped Value Functions] in your Webpack configuration:

```js
module.exports = {
module: {
rules: [
{
test: /\.css$/i,
use: [
"style-loader",
{
loader: "css-loader",
options: { importLoaders: 1 },
},
{
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: [
[
"@csstools/postcss-stepped-value-functions",
{
// Options
},
],
],
},
},
},
],
},
],
},
};
```

## Create React App

Add [React App Rewired] and [React App Rewire PostCSS] to your project:

```bash
npm install react-app-rewired react-app-rewire-postcss @csstools/postcss-stepped-value-functions --save-dev
```

Use [React App Rewire PostCSS] and [PostCSS Stepped Value Functions] in your
`config-overrides.js` file:

```js
const reactAppRewirePostcss = require('react-app-rewire-postcss');
const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');

module.exports = config => reactAppRewirePostcss(config, {
plugins: () => [
postcssSteppedValueFunctions(/* pluginOptions */)
]
});
```

## Gulp

Add [Gulp PostCSS] to your project:

```bash
npm install gulp-postcss @csstools/postcss-stepped-value-functions --save-dev
```

Use [PostCSS Stepped Value Functions] in your Gulpfile:

```js
const postcss = require('gulp-postcss');
const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');

gulp.task('css', function () {
var plugins = [
postcssSteppedValueFunctions(/* pluginOptions */)
];

return gulp.src('./src/*.css')
.pipe(postcss(plugins))
.pipe(gulp.dest('.'));
});
```

## Grunt

Add [Grunt PostCSS] to your project:

```bash
npm install grunt-postcss @csstools/postcss-stepped-value-functions --save-dev
```

Use [PostCSS Stepped Value Functions] in your Gruntfile:

```js
const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
postcss: {
options: {
processors: [
postcssSteppedValueFunctions(/* pluginOptions */)
]
},
dist: {
src: '*.css'
}
}
});
```

[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS CLI]: https://github.com/postcss/postcss-cli
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Stepped Value Functions]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
[React App Rewired]: https://github.com/timarney/react-app-rewired
Loading