Skip to content

Commit

Permalink
Export rgb colors as hex - rgba are still exported as rgba
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Feb 22, 2019
1 parent 7261c54 commit 23a7958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transformVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ function getSassValue(sassVar, options) {

case 'SassColor': {
const {
r, g, b, a,
r, g, b, a, hex,
} = value;
const hasAlpha = a !== 1;
return hasAlpha
? `rgba(${r.toFixed()}, ${g.toFixed()}, ${b.toFixed()}, ${a})`
: `rgb(${r.toFixed()}, ${g.toFixed()}, ${b.toFixed()})`;
: hex;
}

case 'SassList': {
Expand Down

0 comments on commit 23a7958

Please sign in to comment.