Skip to content

Commit 8dd703d

Browse files
authored
fix: svg style mapping (#96)
1 parent f8ca08b commit 8dd703d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/compiler/__tests__/declarations.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const tests = [
55
["-rn-ripple-color: black;", [{ d: [["black", ["android_ripple", "color"]]], s: [1, 1] }]],
66
["-rn-ripple-style: borderless;", [{ d: [[true, ["android_ripple", "borderless"]]], s: [1, 1] }]],
77
["caret-color: black", [{ d: [["#000", ["cursorColor"]]], s: [1, 1] }]],
8+
["fill: black;", [{ d: [["#000", ["fill"]]], s: [1, 1] }]],
89
["stroke: black;", [{ d: [["#000", ["stroke"]]], s: [1, 1] }]],
10+
["stroke-width: 1px;", [{ d: [[1, ["strokeWidth"]]], s: [1, 1] }]],
911
["rotate: 3deg;", [{ d: [[[{}, "rotateZ", "3deg"], "rotateZ"]], s: [1, 1] }]],
1012
["rotate: x 3deg;", [{ d: [[[{}, "rotateX", "3deg"], "rotateX"]], s: [1, 1] }]],
1113
] as const;

src/compiler/atRules.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export function parsePropAtRule(rules?: (Rule | PropAtRule)[]) {
8282
// Include any default mapping here
8383
const mapping: StyleRuleMapping = {
8484
"caret-color": ["cursorColor"],
85+
"fill": ["fill"],
86+
"stroke": ["stroke"],
87+
"stroke-width": ["strokeWidth"],
8588
"-webkit-line-clamp": ["numberOfLines"],
8689
"-rn-ripple-color": ["android_ripple", "color"],
8790
"-rn-ripple-style": ["android_ripple", "borderless"],

src/compiler/declarations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,6 @@ export function parseSVGPaint(
24582458
return;
24592459
}
24602460

2461-
builder.addMapping({ [property]: [property] });
24622461
builder.addDescriptor(property, parsedValue);
24632462
}
24642463

0 commit comments

Comments
 (0)