diff --git a/src/components/parser.cpp b/src/components/parser.cpp index 83c50500..423127d4 100644 --- a/src/components/parser.cpp +++ b/src/components/parser.cpp @@ -192,7 +192,7 @@ unsigned int parser::parse_color(std::stack& color_stack, string& color_stack.pop(); } auto parsed_value = parse_color_string(value, !color_stack.empty() ? color_stack.top() : fallback); - if (!value.empty() && value[0] != '-') { + if (!value.empty() && value[0] != '-' && (color_stack.empty() || (parsed_value != color_stack.top()))) { color_stack.push(parsed_value); } return parsed_value;