Skip to content

✨ Runtime CSS Decorator for custom elements #251

Closed

Description

@1aron

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')
@cssRuntime(config)
export class MyElement extends LitElement {}

Activity

  1. changed the title [-]✨ Master CSS Runtime Decorator for custom elements[/-] [+]✨ Runtime CSS Decorator for custom elements[/+] on Dec 12, 2023
  2. added theissue type on Mar 24, 2025
  3. locked and limited conversation to collaborators on Apr 11, 2025
  4. converted this issue into a discussion #390 on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions