11#include " VariableContext.hpp"
22#include " Rules.hpp"
3+ #include " StyledResolver.hpp"
34
45namespace margelo ::nitro::cssnitro {
56
@@ -56,11 +57,8 @@ namespace margelo::nitro::cssnitro {
5657 auto &valueMap = contextIt->second .values ;
5758 auto varIt = valueMap.find (name);
5859 if (varIt != valueMap.end ()) {
59- auto result = getValue (varIt->second , get);
60- // If the value is not nullopt, return it
61- if (!std::holds_alternative<std::monostate>(result)) {
62- return result;
63- }
60+ AnyValue value = getValue (varIt->second , get);
61+ return StyledResolver::resolveStyle (value, contextKey, get);
6462 } else {
6563 // Variable doesn't exist in this context
6664 // Check if this is a root or universal context
@@ -71,10 +69,8 @@ namespace margelo::nitro::cssnitro {
7169 valueMap[name] = computed;
7270
7371 // Get the initial value from the computed
74- auto result = get (*computed);
75- if (!std::holds_alternative<std::monostate>(result)) {
76- return result;
77- }
72+ AnyValue value = getValue (computed, get);
73+ return StyledResolver::resolveStyle (value, contextKey, get);
7874 } else {
7975 // For other contexts, create a new Observable with nullptr
8076 auto observable = reactnativecss::Observable<AnyValue>::create (AnyValue ());
0 commit comments