Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin/vaadin-themable-mixin

Package Overview
Dependencies
Maintainers
19
Versions
469
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 21.0.0-alpha0.b163d3a8c to 21.0.0-alpha1

4

package.json
{
"name": "@vaadin/vaadin-themable-mixin",
"version": "21.0.0-alpha0.b163d3a8c",
"version": "21.0.0-alpha1",
"description": "vaadin-themable-mixin",

@@ -37,3 +37,3 @@ "main": "vaadin-themable-mixin.js",

},
"gitHead": "e1ed53b0be7b77493e3a23a076f4e47c16674dbd"
"gitHead": "8542c7dadc4c86e454a48613f0f2d027dcb5aa86"
}

@@ -1,2 +0,2 @@

import { CSSResult } from 'lit';
import { CSSResultGroup } from 'lit';

@@ -9,8 +9,4 @@ export { css, unsafeCSS } from 'lit';

*/
declare function registerStyles(
themeFor: String | null,
styles: CSSResult | Array<CSSResult | null> | null,
options?: object | null
): void;
declare function registerStyles(themeFor: string | null, styles: CSSResultGroup, options?: object | null): void;
export { registerStyles };
import '@polymer/polymer/lib/elements/dom-module.js';
import { CSSResult } from 'lit';
import { stylesFromTemplate } from '@polymer/polymer/lib/utils/style-gather.js';
export { css, unsafeCSS } from 'lit';

@@ -14,3 +15,3 @@

* @param {String} themeFor The local/tag name of the component type to register the styles for
* @param {CSSResult | CSSResult[]} styles The CSS style rules to be registered for the component type
* @param {CSSResultGroup} styles The CSS style rules to be registered for the component type
* matching themeFor and included in the local scope of each component instance

@@ -27,3 +28,3 @@ * @param {Object=} options Additional options

styles.forEach((cssResult) => {
const processedStyles = styles.map((cssResult) => {
if (!(cssResult instanceof CSSResult)) {

@@ -33,13 +34,9 @@ throw new Error('An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`.');

if (!styleMap[cssResult]) {
const styleModuleElement = document.createElement('dom-module');
styleModuleElement.innerHTML = `
<template>
<style>${cssResult.toString()}</style>
</template>
`;
const template = document.createElement('template');
template.innerHTML = `<style>${cssResult.toString()}</style>`;
const styleId = `custom-style-module-${moduleIdIndex++}`;
styleModuleElement.register(styleId);
styleMap[cssResult] = styleId;
styleMap[cssResult] = stylesFromTemplate(template)[0];
}
return styleMap[cssResult].textContent;
});

@@ -64,3 +61,3 @@

${moduleIncludes.map((include) => `<style include=${include}></style>`)}
${styles.map((style) => `<style include=${styleMap[style]}></style>`)}
${processedStyles.length ? `<style>${processedStyles.join('\n')}</style>` : ''}
</template>

@@ -67,0 +64,0 @@ `;

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