@builder.io/mitosis 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -137,8 +137,8 @@ const getStyleStringFromBlock = (block, options) => {
|
|
|
137
137
|
* responsiveStyles.large.background: "state.background"
|
|
138
138
|
* Should get mapped to:
|
|
139
139
|
* @media (max-width: 1200px): {
|
|
140
|
-
* color:
|
|
141
|
-
* background:
|
|
140
|
+
* color: state.color,
|
|
141
|
+
* background: state.background
|
|
142
142
|
* }
|
|
143
143
|
*/
|
|
144
144
|
}
|
|
@@ -156,9 +156,16 @@ const getStyleStringFromBlock = (block, options) => {
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
/**
|
|
160
|
+
* All binding values are strings, but we don't want to stringify the values
|
|
161
|
+
* within the style object otherwise the bindings will be evaluated as strings.
|
|
162
|
+
* As a result, do not use JSON.stringify here.
|
|
163
|
+
*/
|
|
160
164
|
for (const key in responsiveStyles) {
|
|
161
|
-
|
|
165
|
+
const styles = Object.keys(responsiveStyles[key]);
|
|
166
|
+
const keyValues = styles.map((prop) => `${prop}: ${responsiveStyles[key][prop]}`);
|
|
167
|
+
const stringifiedObject = `{ ${keyValues.join(', ')} }`;
|
|
168
|
+
styleBindings[key] = stringifiedObject;
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
const styleKeys = Object.keys(styleBindings);
|