Created
March 22, 2020 11:00
-
-
Save na0x2c6/5b0da891d6f4c567e9c817167e1b5000 to your computer and use it in GitHub Desktop.
LitElement with embed a scss (for IE).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>` | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: white; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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