@vaadin/vaadin-themable-mixin
Advanced tools
Comparing version 22.0.0-alpha4 to 22.0.0-alpha5
{ | ||
"name": "@vaadin/vaadin-themable-mixin", | ||
"version": "22.0.0-alpha4", | ||
"version": "22.0.0-alpha5", | ||
"description": "vaadin-themable-mixin", | ||
@@ -37,3 +37,3 @@ "main": "vaadin-themable-mixin.js", | ||
}, | ||
"gitHead": "86c025abd605d5a4a3c0ae36eb07c34704cee1f2" | ||
"gitHead": "012f658db6f81375be8889f63ee15e3f660fe9ec" | ||
} |
@@ -10,2 +10,11 @@ import '@polymer/polymer/lib/elements/dom-module.js'; | ||
function recursiveFlattenStyles(styles, result = []) { | ||
if (styles instanceof CSSResult) { | ||
result.push(styles); | ||
} else if (Array.isArray(styles)) { | ||
styles.forEach((style) => recursiveFlattenStyles(style, result)); | ||
} | ||
return result; | ||
} | ||
/** | ||
@@ -22,2 +31,8 @@ * Registers CSS styles for a component type. Make sure to register the styles before | ||
export const registerStyles = (themeFor, styles, options) => { | ||
if (options && options.include && !options.suppressDeprecationWarning) { | ||
console.warn( | ||
`The "include" option in registerStyles is deprecated. Instead, include an imported CSSResult in the styles array.` | ||
); | ||
} | ||
const themeId = (options && options.moduleId) || `custom-style-module-${moduleIdIndex++}`; | ||
@@ -29,2 +44,4 @@ | ||
styles = recursiveFlattenStyles(styles); | ||
const processedStyles = styles.map((cssResult) => { | ||
@@ -31,0 +48,0 @@ if (!(cssResult instanceof CSSResult)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21173
218