Skip to content

Commit 421e869

Browse files
committed
Always use shortest colour in compressed mode
1 parent 3672661 commit 421e869

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

eval.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,10 @@ namespace Sass {
790790
zero);
791791
break;
792792
case Textual::HEX: {
793+
if (t->value().substr(0, 1) != "#") {
794+
result = new (ctx.mem) String_Constant(t->pstate(), t->value());
795+
break;
796+
}
793797
string hext(t->value().substr(1)); // chop off the '#'
794798
if (hext.length() == 6) {
795799
string r(hext.substr(0,2));

inspect.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ namespace Sass {
582582
hexlet << hex << setw(2) << static_cast<unsigned long>(b);
583583
}
584584

585+
if (want_short && !c->is_delayed()) name = "";
586+
585587
// retain the originally specified color definition if unchanged
586588
if (name != "") {
587589
ss << name;

parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ namespace Sass {
10031003
}
10041004
else if (lex< sequence< optional< exactly<'*'> >, identifier > >()) {
10051005
prop = new (ctx.mem) String_Quoted(pstate, lexed);
1006+
prop->is_delayed(true);
10061007
}
10071008
else {
10081009
error("invalid property name", pstate);
@@ -1487,7 +1488,7 @@ namespace Sass {
14871488
--position;
14881489

14891490
String_Constant* str_node = new (ctx.mem) String_Constant(pstate, str.time_wspace());
1490-
// str_node->is_delayed(true);
1491+
str_node->is_delayed(true);
14911492
return str_node;
14921493
}
14931494

0 commit comments

Comments
 (0)