Skip to content

Commit

Permalink
vaev-style: Setup two pass for custom properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Nov 26, 2024
1 parent f6c4af4 commit d581ebb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/vaev-style/computer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,22 @@ Strong<Computed> Computer::computeFor(Computed const &parent, Markup::Element co
computed->inherit(parent);
Vec<Cursor<StyleProp>> importantProps;

// HACK: Apply custom properties first
for (auto const &styleRule : matchingRules) {
for (auto &prop : styleRule->props) {
if (prop.important == Important::NO)
if (prop.is<CustomProp>())
prop.apply(*computed);
else
importantProps.pushBack(&prop);
}
}

for (auto const &styleRule : matchingRules) {
for (auto &prop : styleRule->props) {
if (not prop.is<CustomProp>()) {
if (prop.important == Important::NO)
prop.apply(*computed);
else
importantProps.pushBack(&prop);
}
}
}

Expand Down

0 comments on commit d581ebb

Please sign in to comment.