-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use default tailwind separator ":"
- Loading branch information
mcha
committed
Jun 13, 2021
1 parent
42b3ae2
commit 3e0e90f
Showing
5 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
# rollup-plugin-lit-tailwindcss | ||
|
||
```js | ||
import litTw from 'rollup-plugin-lit-tailwindcss'; | ||
import litTailwind from 'rollup-plugin-lit-tailwindcss'; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: { | ||
dir: 'dist', | ||
}, | ||
plugins: [ | ||
litTw({ | ||
litTailwind({ | ||
include: 'src/components/**/*.ts', | ||
placeholder: 'tw_placeholder', | ||
placeholder: undefined, | ||
}), | ||
], | ||
}; | ||
``` | ||
|
||
lit component | ||
Then in `lit` component file: | ||
|
||
```ts | ||
import { html, css, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
|
||
@customElement('simple-component') | ||
@customElement('simple-footer') | ||
export class SimpleComponent extends LitElement { | ||
static styles = css`tw_placeholder`; | ||
static styles = css`tw_placeholder`; // 👈 classes will be injected here | ||
|
||
render() { | ||
return html`<h1 class="text-purple-400 hover_text-green-500">Hello, world!</h1>`; | ||
return html`<h1 | ||
class="text-purple-400 md:text-red-400 md:hover:text-green-500" | ||
> | ||
Hello, world! | ||
</h1>`; | ||
} | ||
} | ||
``` | ||
|
||
## Todos | ||
|
||
## Todo | ||
- is this performant??? | ||
- tailwind separator (`_` to default one `:`) | ||
- read tailwind config, styles.css? | ||
- ... |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// dev only | ||
module.exports = { | ||
purge: [], | ||
darkMode: false, // or 'media' or 'class' | ||
theme: { | ||
extend: {}, | ||
}, | ||
variants: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} |
This file contains 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