Emit transparent colors in rgba format (#157)

Closes #1782
This commit is contained in:
Natalie Weizenbaum 2017-07-06 17:49:03 -07:00 committed by GitHub
parent 0851350068
commit b5157905f4
2 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,10 @@
* Add support for the `::slotted()` pseudo-element.
* Generated transparent colors will now be emitted as `rgba(0, 0, 0, 0)` rather
than `transparent`. This works around a bug wherein IE incorrectly handles the
latter format.
### Node JS API
* Add support for `lineFeed`, `indentWidth`, and `indentType` options to

View File

@ -317,7 +317,10 @@ class _SerializeCssVisitor
void visitColor(SassColor value) {
if (value.original != null) {
_buffer.write(value.original);
} else if (namesByColor.containsKey(value)) {
} else if (namesByColor.containsKey(value) &&
// Always emit generated transparent colors in rgba format. This works
// around an IE bug. See sass/sass#1782.
!fuzzyEquals(value.alpha, 0)) {
_buffer.write(namesByColor[value]);
} else if (value.alpha == 1) {
_buffer.writeCharCode($hash);