Commit 3b77692
fix: don't add opacity modifier for variable colors (#250)
When a color is from a Figma variable that already contains alpha,
the output was incorrectly adding an opacity modifier like /50.
For example, a variable 'myVar' defined as rgba(255,0,0,0.5) was
generating 'bg-myVar/50' instead of just 'bg-myVar'.
The fix skips the opacity modifier when colorType is 'variable'
since the alpha is already baked into the variable definition.
Adding the modifier would incorrectly compound the opacity.
Fixes #232
Co-authored-by: Michael Golden <michael@wayframe.com>1 parent 6fcdcc3 commit 3b77692
1 file changed
Lines changed: 17 additions & 2 deletions
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
| |||
0 commit comments