Socket
Socket
Sign inDemoInstall

@vaadin/vaadin-themable-mixin

Package Overview
Dependencies
Maintainers
14
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/vaadin-themable-mixin - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

package.json

@@ -12,3 +12,3 @@ {

"name": "@vaadin/vaadin-themable-mixin",
"version": "1.3.3",
"version": "1.3.4",
"main": "vaadin-themable-mixin.js",

@@ -15,0 +15,0 @@ "author": "Vaadin Ltd",

@@ -34,15 +34,35 @@ import { DomModule } from '@polymer/polymer/lib/elements/dom-module.js';

Object.keys(modules).forEach(moduleName => {
if (moduleName !== defaultModuleName) {
const themeFor = modules[moduleName].getAttribute('theme-for');
if (themeFor) {
themeFor.split(' ').forEach(themeForToken => {
if (new RegExp('^' + themeForToken.split('*').join('.*') + '$').test(this.is)) {
hasThemes = true;
this._includeStyle(moduleName, template);
}
});
Object.keys(modules)
.sort((moduleNameA, moduleNameB) => {
const vaadinA = moduleNameA.indexOf('vaadin-') === 0;
const vaadinB = moduleNameB.indexOf('vaadin-') === 0;
const vaadinThemePrefixes = ['lumo-', 'material-'];
const vaadinThemeA = vaadinThemePrefixes.filter(prefix => moduleNameA.indexOf(prefix) === 0).length > 0;
const vaadinThemeB = vaadinThemePrefixes.filter(prefix => moduleNameB.indexOf(prefix) === 0).length > 0;
if (vaadinA !== vaadinB) {
// Include vaadin core styles first
return vaadinA ? -1 : 1;
} else if (vaadinThemeA !== vaadinThemeB) {
// Include vaadin theme styles after that
return vaadinThemeA ? -1 : 1;
} else {
// Lastly include custom styles so they override all vaadin styles
return 0;
}
}
});
})
.forEach(moduleName => {
if (moduleName !== defaultModuleName) {
const themeFor = modules[moduleName].getAttribute('theme-for');
if (themeFor) {
themeFor.split(' ').forEach(themeForToken => {
if (new RegExp('^' + themeForToken.split('*').join('.*') + '$').test(this.is)) {
hasThemes = true;
this._includeStyle(moduleName, template);
}
});
}
}
});

@@ -49,0 +69,0 @@ if (!hasThemes && modules[defaultModuleName]) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc