Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Runtime CSS Decorator for custom elements #251

Open
1aron opened this issue Jun 20, 2023 · 0 comments
Open

✨ Runtime CSS Decorator for custom elements #251

1aron opened this issue Jun 20, 2023 · 0 comments
Labels
feature New feature lit

Comments

@1aron
Copy link
Member

1aron commented Jun 20, 2023

Description

Current

import { customElement } from 'lit/decorators.js'
import MasterCSS from '@master/css'
import config from '../master.css'

@customElement('my-element')
export class MyElement extends LitElement {
    css: MasterCSS

    connectedCallback() {
        super.connectedCallback()
        this.css = new MasterCSS({
            ...config,
            observe: false
        }).observe(this.shadowRoot)
    }

    disconnectedCallback() {
        super.disconnectedCallback()
        this.css?.destroy()
    }
}

Expect

import { customElement } from 'lit/decorators.js'
import { runtimeCSS } from '@master/css'
import config from '../master.css'

@customElement('my-element')
@runtimeCSS(config)
export class MyElement extends LitElement {}
@1aron 1aron added the feature New feature label Sep 18, 2023
@1aron 1aron changed the title ✨ Master CSS Runtime Decorator for custom elements ✨ Runtime CSS Decorator for custom elements Dec 12, 2023
@1aron 1aron removed the css label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature lit
Projects
None yet
Development

No branches or pull requests

1 participant