Skip to content

Instantly share code, notes, and snippets.

@na0x2c6
Created March 22, 2020 11:00
Show Gist options
  • Save na0x2c6/5b0da891d6f4c567e9c817167e1b5000 to your computer and use it in GitHub Desktop.
Save na0x2c6/5b0da891d6f4c567e9c817167e1b5000 to your computer and use it in GitHub Desktop.
LitElement with embed a scss (for IE).
import { LitElement, html, unsafeCSS } from 'lit-element';
import style from './scss/style.scss';
@customElement('some-component')
export default class SomeComponent extends LitElement {
static get styles() {
return [
// If you don't need to consider IE, you can use a link tag to include style in the render function.
unsafeCSS(style),
]
}
render() {
html`<div>hello, world</div>`
}
}
body {
background-color: white;
}
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
'raw-loader',
'sass-loader',
],
},
],
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment