Skip to content

Adding PostCSS Trigonometric Functions to PostCSS Preset Env #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions package-lock.json

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

15 changes: 11 additions & 4 deletions plugin-packs/postcss-preset-env/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Changes to PostCSS Preset Env

### 7.7.0 (Unreleased)

- Added `@csstools/postcss-trigonometric-functions` <br/> [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions#readme) for usage details.
- Updated `@csstools/postcss-cascade-layers` to `1.0.2` (patch)
- Updated `postcss-color-functional-notation` to `4.2.3` (patch)
- Updated `postcss-nesting` to `10.1.7` (patch)

### 7.6.0 (May 19, 2022)

- Added `@csstools/postcss-cascade-layers` <br/> [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers#readme) for usage details.
- Updated `@csstools/postcss-hwb-function` to `1.0.1` (patch)
- Updated `@csstools/postcss-is-pseudo-class` to `2.0.4` (patch)
- Updated `@csstools/postcss-unset-value` to `1.0.1` (patch)
- Updated `@csstools/postcss-hwb-function` to `1.0.1` (patch)
- Updated `@csstools/postcss-is-pseudo-class` to `2.0.4` (patch)
- Updated `@csstools/postcss-unset-value` to `1.0.1` (patch)
- Updated `postcss-nesting` to `10.1.6` (patch)
- Updated `postcss-pseudo-class-any-link` to `7.1.4` (patch)
- Updated `postcss-pseudo-class-any-link` to `7.1.4` (patch)

### 7.5.0 (May 2, 2022)

Expand Down
7 changes: 4 additions & 3 deletions plugin-packs/postcss-preset-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dist"
],
"dependencies": {
"@csstools/postcss-cascade-layers": "^1.0.1",
"@csstools/postcss-cascade-layers": "^1.0.2",
"@csstools/postcss-color-function": "^1.1.0",
"@csstools/postcss-font-format-keywords": "^1.0.0",
"@csstools/postcss-hwb-function": "^1.0.1",
Expand All @@ -37,6 +37,7 @@
"@csstools/postcss-oklab-function": "^1.1.0",
"@csstools/postcss-progressive-custom-properties": "^1.3.0",
"@csstools/postcss-stepped-value-functions": "^1.0.0",
"@csstools/postcss-trigonometric-functions": "^1.0.0",
"@csstools/postcss-unset-value": "^1.0.1",
"autoprefixer": "^10.4.7",
"browserslist": "^4.20.3",
Expand All @@ -46,7 +47,7 @@
"cssdb": "^6.6.2",
"postcss-attribute-case-insensitive": "^5.0.0",
"postcss-clamp": "^4.1.0",
"postcss-color-functional-notation": "^4.2.2",
"postcss-color-functional-notation": "^4.2.3",
"postcss-color-hex-alpha": "^8.0.3",
"postcss-color-rebeccapurple": "^7.0.2",
"postcss-custom-media": "^8.0.0",
Expand All @@ -64,7 +65,7 @@
"postcss-lab-function": "^4.2.0",
"postcss-logical": "^5.0.4",
"postcss-media-minmax": "^5.0.0",
"postcss-nesting": "^10.1.6",
"postcss-nesting": "^10.1.7",
"postcss-opacity-percentage": "^1.1.2",
"postcss-overflow-shorthand": "^3.0.3",
"postcss-page-break": "^3.0.4",
Expand Down
5 changes: 5 additions & 0 deletions plugin-packs/postcss-preset-env/scripts/plugins-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,10 @@
"packageName": "@csstools/postcss-cascade-layers",
"id": "cascade-layers",
"importName": "postcssCascadeLayers"
},
{
"packageName": "@csstools/postcss-trigonometric-functions",
"id": "trigonometric-functions",
"importName": "postcssTrigonometricFunctions"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ export default [
'place-properties',
'system-ui-font-family',
'cascade-layers',
'stepped-value-functions',
'trigonometric-functions',
];
2 changes: 2 additions & 0 deletions plugin-packs/postcss-preset-env/src/plugins/plugins-by-id.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import postcssPrefersColorScheme from 'css-prefers-color-scheme';
import postcssColorRebeccapurple from 'postcss-color-rebeccapurple';
import postcssSteppedValueFunctions from '@csstools/postcss-stepped-value-functions';
import postcssFontFamilySystemUI from '../patch/postcss-system-ui-font-family.mjs';
import postcssTrigonometricFunctions from '@csstools/postcss-trigonometric-functions';
import postcssUnsetValue from '@csstools/postcss-unset-value';

// postcss plugins ordered by id
Expand Down Expand Up @@ -85,6 +86,7 @@ export const pluginsById = new Map(
['rebeccapurple-color', postcssColorRebeccapurple],
['stepped-value-functions', postcssSteppedValueFunctions],
['system-ui-font-family', postcssFontFamilySystemUI],
['trigonometric-functions', postcssTrigonometricFunctions],
['unset-value', postcssUnsetValue],
],
);
5 changes: 5 additions & 0 deletions plugin-packs/postcss-preset-env/src/plugins/plugins-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,9 @@ export default [
'id': 'cascade-layers',
'importName': 'postcssCascadeLayers',
},
{
'packageName': '@csstools/postcss-trigonometric-functions',
'id': 'trigonometric-functions',
'importName': 'postcssTrigonometricFunctions',
},
];
33 changes: 33 additions & 0 deletions plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,36 @@
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,36 @@
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
33 changes: 33 additions & 0 deletions plugin-packs/postcss-preset-env/test/basic.ch38.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -471,3 +471,36 @@
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,36 @@ h1.test-custom-selectors,h2.test-custom-selectors,h3.test-custom-selectors,h4.te
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
33 changes: 33 additions & 0 deletions plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,36 @@ h1.test-custom-selectors,h2.test-custom-selectors,h3.test-custom-selectors,h4.te
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,36 @@ h1.test-custom-selectors,h2.test-custom-selectors,h3.test-custom-selectors,h4.te
bottom: 2px;
left: 2px;
}

.trigonometric {
left: 0.70711;
left: 0.70711;
left: 1;
left: 30deg;
left: 60deg;
left: 84.29deg;
left: -45deg;
left: 90deg;
left: 135deg;
left: 0.90533;
}

.trigonometric-ignore-not-a-function {
left: sin;
left: cos;
left: tan;
left: asin;
left: acos;
left: atan;
left: atan2;
}

.trigonometric-ignore-no-arguments {
left: sin();
left: cos();
left: tan();
left: asin();
left: acos();
left: atan();
left: atan2();
}
Loading