1.0.0-alpha.1 • Published 4 years ago
lit-inline-css v1.0.0-alpha.1
LitInlineCss
Me likes seperate CSS files. This project fills the gaps in typed-css-modules with rollup. note that this is a project that is still under development and does not yet have any stable releases
How it works
Example input - output
import { LitElement, html } from 'lit-element'
import { classMap } from 'lit-element/directives/class-map'
import style from './style.css'
class ExampleComponent extends LitElement {
render() {
const classes = classMap({
[style.a]: this.isA,
[style['a-b']]: this.isAB,
})
/* ... */
}
}
ExampleComponent.styles = style
import { LitElement, html, css } from 'lit-element'
import { classMap } from 'lit-element/directives/class-map'
class ExampleComponent extends LitElement {
render() {
const classes = classMap({
'a': this.isA,
'a-b': this.isAB,
})
/* ... */
}
}
ExampleComponent.styles = css`.a { display: block; } .a-b { display: inline; }`
Typescript
You can either generate typings (.d.ts
) files or declare a module (declare module '*.css'
) so that you can import the styles without warnings.
1.0.0-alpha.8
4 years ago
1.0.0-alpha.7
4 years ago
1.0.0-alpha.6
4 years ago
1.0.0-alpha.5
4 years ago
1.0.0-alpha.4
4 years ago
1.0.0-alpha.3
4 years ago
1.0.0-alpha.2
4 years ago
1.0.0-alpha.1
4 years ago