Skip to content

Commit 6da885e

Browse files
authored
various fixes (#289)
1 parent 8feed04 commit 6da885e

File tree

16 files changed

+511
-153
lines changed

16 files changed

+511
-153
lines changed

plugins/postcss-double-position-gradients/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Unreleased (patch)
44

55
- Add typescript support
6+
- Fix color functions.
67
- Fix `at` keyword with `at 20px 20px` being interpreted as a double position color stop.
78

89
### 3.1.0 (February 15, 2022)

plugins/postcss-double-position-gradients/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const basePlugin = (opts) => {
9898
// if the argument concludes a double-position gradient
9999
if (isDoublePositionLength) {
100100
// insert the fallback colors
101-
const color = { type: twoValuesBack.type, value: twoValuesBack.value };
101+
const color = twoValuesBack;
102102
const comma = {
103103
type: 'div',
104104
value: ',',

plugins/postcss-double-position-gradients/test/basic.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,11 @@
5656
.test-color-space-interop {
5757
background: linear-gradient(in lab to right, #44C 0% 10%, #795)
5858
}
59+
60+
.repeating-conic {
61+
background: repeating-conic-gradient(
62+
from 3deg,
63+
hsl(200, 100%, 50%) 0deg 15deg,
64+
hsl(200, 100%, 60%) 10deg 30deg
65+
);
66+
}

plugins/postcss-double-position-gradients/test/basic.expect.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,16 @@
9191
background: linear-gradient(in lab to right, #44C 0%,#44C 10%, #795);
9292
background: linear-gradient(in lab to right, #44C 0% 10%, #795)
9393
}
94+
95+
.repeating-conic {
96+
background: repeating-conic-gradient(
97+
from 3deg,
98+
hsl(200, 100%, 50%) 0deg,hsl(200, 100%, 50%) 15deg,
99+
hsl(200, 100%, 60%) 10deg, hsl(200, 100%, 60%) 30deg
100+
);
101+
background: repeating-conic-gradient(
102+
from 3deg,
103+
hsl(200, 100%, 50%) 0deg 15deg,
104+
hsl(200, 100%, 60%) 10deg 30deg
105+
);
106+
}

plugins/postcss-double-position-gradients/test/basic.preserve.expect.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,11 @@
5656
.test-color-space-interop {
5757
background: linear-gradient(in lab to right, #44C 0%,#44C 10%, #795)
5858
}
59+
60+
.repeating-conic {
61+
background: repeating-conic-gradient(
62+
from 3deg,
63+
hsl(200, 100%, 50%) 0deg,hsl(200, 100%, 50%) 15deg,
64+
hsl(200, 100%, 60%) 10deg, hsl(200, 100%, 60%) 30deg
65+
);
66+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to PostCSS Gradients Interpolation Method
22

3+
### Unreleased (patch)
4+
5+
- fix dependencies
6+
37
### 1.0.0 (March 4, 2022)
48

59
- Initial version

plugins/postcss-gradients-interpolation-method/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"README.md",
2424
"dist"
2525
],
26-
"peerDependencies": {
27-
"postcss": "^8.3"
28-
},
29-
"devDependencies": {
26+
"dependencies": {
3027
"@csstools/postcss-progressive-custom-properties": "^1.1.0",
3128
"postcss-value-parser": "^4.2.0"
3229
},
30+
"peerDependencies": {
31+
"postcss": "^8.3"
32+
},
3333
"scripts": {
3434
"build": "rollup -c ../../rollup/default.js",
3535
"clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",

plugins/postcss-progressive-custom-properties/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Changes to PostCSS Progressive Custom Properties
22

3-
## Unreleased (patch)
3+
## Unreleased (minor)
44

5+
- Add matching rules for `color-mix`
56
- fix matching rules for gradient functions
7+
- reduce matchers size
68

79
## 1.2.0 (February 15, 2022)
810

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { matcherForValue } from './matcher-for-value.mjs';
2+
3+
export const colorMixMatchers = [
4+
{
5+
'supports': 'color-mix(in oklch, #000, #fff)',
6+
'property': 'color',
7+
'sniff': 'color-mix',
8+
'matchers': [
9+
matcherForValue('color-mix(in $a,$1,$2)'),
10+
matcherForValue('color-mix(in $a,$1 $2,$3)'),
11+
matcherForValue('color-mix(in $a,$1,$2 $3)'),
12+
matcherForValue('color-mix(in $a,$1 $2,$3 $4)'),
13+
14+
matcherForValue('color-mix(in $a $b,$1,$2)'),
15+
matcherForValue('color-mix(in $a $b,$1 $2,$3)'),
16+
matcherForValue('color-mix(in $a $b,$1,$2 $3)'),
17+
matcherForValue('color-mix(in $a $b,$1 $2,$3 $4)'),
18+
],
19+
},
20+
];

plugins/postcss-progressive-custom-properties/generate/color.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const hslMatchers = [
3131
'sniff': 'hsl',
3232
'matchers': [
3333
matcherForValue('hsl($1,$2,$3,$4)'),
34-
matcherForValue('hsl($1, $2, $3, $4)'),
3534
],
3635
},
3736
{
@@ -119,7 +118,6 @@ export const rgbMatchers = [
119118
'property': 'color',
120119
'sniff': 'rgb',
121120
'matchers': [
122-
matcherForValue('rgb($1, $2, $3, $4)'),
123121
matcherForValue('rgb($1,$2,$3,$4)'),
124122
],
125123
},

0 commit comments

Comments
 (0)