* Resolves ThemingInstruction objects in an array and joins the result into a string. * @param {ThemableArray} splitStyleArray ThemableArray to resolve and join.
(splitStyleArray)
| 27174 | * Resolves ThemingInstruction objects in an array and joins the result into a string. |
| 27175 | * @param {ThemableArray} splitStyleArray ThemableArray to resolve and join. |
| 27176 | */ function resolveThemableArray(splitStyleArray) { |
| 27177 | var theme = _themeState.theme; |
| 27178 | var themable = false; |
| 27179 | // Resolve the array of theming instructions to an array of strings. |
| 27180 | // Then join the array to produce the final CSS string. |
| 27181 | var resolvedArray = (splitStyleArray || []).map(function(currentValue) { |
| 27182 | var themeSlot = currentValue.theme; |
| 27183 | if (themeSlot) { |
| 27184 | themable = true; |
| 27185 | // A theming annotation. Resolve it. |
| 27186 | var themedValue = theme ? theme[themeSlot] : undefined; |
| 27187 | var defaultValue = currentValue.defaultValue || "inherit"; |
| 27188 | // Warn to console if we hit an unthemed value even when themes are provided, but only if "DEBUG" is true. |
| 27189 | // Allow the themedValue to be undefined to explicitly request the default value. |
| 27190 | if (theme && !themedValue && console && !(themeSlot in theme) && typeof DEBUG !== "undefined" && DEBUG) console.warn('Theming value not provided for "'.concat(themeSlot, '". Falling back to "').concat(defaultValue, '".')); |
| 27191 | return themedValue || defaultValue; |
| 27192 | } else // A non-themable string. Preserve it. |
| 27193 | return currentValue.rawString; |
| 27194 | }); |
| 27195 | return { |
| 27196 | styleString: resolvedArray.join(""), |
| 27197 | themable: themable |
| 27198 | }; |
| 27199 | } |
| 27200 | function splitStyles(styles) { |
| 27201 | var result = []; |
| 27202 | if (styles) { |
no test coverage detected