How to use the lit-element.unsafeCSS function in lit-element

To help you get started, we’ve selected a few lit-element examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github axa-ch / patterns-library / src / components / 10-atoms / link / index.js View on Github external
// TODO fix that stuff
/* eslint-disable import/no-extraneous-dependencies */
import '@axa-ch/icon';
import { LitElement, html, css, unsafeCSS } from 'lit-element';
import { classMap } from 'lit-html/directives/class-map';
import linkCSS from './index.scss';
import defineOnce from '../../../utils/define-once';
import { applyDefaults } from '../../../utils/with-react';

class AXALink extends LitElement {
  static tagName = 'axa-link';
  static styles = css`
    ${unsafeCSS(linkCSS)}
  `;

  static get properties() {
    return {
      href: { type: String },
      variant: { type: String },
      icon: { type: String },
      external: { type: Boolean },
      onClick: { type: Function },
    };
  }

  constructor() {
    super();
    applyDefaults(this);
  }
github axa-ch / patterns-library / src / components / 10-atoms / button / index.js View on Github external
static get styles() {
    return css`
      ${unsafeCSS(buttonCSS)}
    `;
  }
github web-padawan / lit-components / packages / polymer-style-module / polymer-style-module.js View on Github external
export const getStyleModule = (id, cb) => {
  const template = DomModule.import(id, 'template');
  let cssText =
    template &&
    stylesFromTemplate(template)
      .map(style => style.textContent)
      .join(' ');
  if (cb) {
    cssText = cb(cssText);
  }
  return unsafeCSS(cssText);
};
github telekom / telements / packages / components-web / src / components / t-button / index.ts View on Github external
import { LitElement, customElement, html, css, unsafeCSS } from "lit-element";
import { button } from '@telements/styles';

const styles = css`
	:host {}
	${unsafeCSS(button)}
`

@customElement('t-button')
export class Button extends LitElement {
	render() {
		return html`
      <style>${styles}</style>
			<button class="button">
				
			</button>
		`}

}

export default Button;
github axa-ch / patterns-library / src / components / 30-organisms / table / components / axa-tr / index.js View on Github external
import { LitElement, html, unsafeCSS, css } from 'lit-element';
import styles from './index.scss';

export default class AXATr extends LitElement {
  static tagName = 'axa-tr';

  static styles = css`
    ${unsafeCSS(styles)}
  `;

  render() {
    return html`
      <div role="row" class="o-table__row"></div>
    `;
  }
}