Skip to content

Commit 792c86b

Browse files
software-opaljonathantneal
authored andcommitted
Retain spacing around color-mod function
1 parent 9ce4b29 commit 792c86b

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

lib/transform.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default function transformAST(node, opts) {
2222
// update the color-mod() function with the transformed value
2323
child.replaceWith(
2424
parser.word({
25+
raws: child.raws,
2526
value: opts.stringifier(color)
2627
})
2728
);

test/basic.colors.expect.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ test-sameness {
127127
test-var {
128128
color: rgb(0% 0% 100%);
129129
}
130+
131+
test-multiple-value-items {
132+
border: 1px solid rgb(100% 0% 0%);
133+
}

test/basic.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ test-sameness {
127127
test-var {
128128
color: color-mod(var(--color));
129129
}
130+
131+
test-multiple-value-items {
132+
border: 1px solid color-mod(red);
133+
}

test/basic.expect.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ test-sameness {
127127
test-var {
128128
color: rgb(0, 0, 255);
129129
}
130+
131+
test-multiple-value-items {
132+
border: 1px solid rgb(255, 0, 0);
133+
}

0 commit comments

Comments
 (0)