0

If we scaffold out a new vite lit project with npm init vite@latest the comment on my-element contains @csspart:

/**
 * An example element.
 *
 * @slot - This element has a slot
 * @csspart button - The button
 */
@customElement('my-element')
export class MyElement extends LitElement {

What is @csspart for?

4
  • 1
    Most likely the ::part CSS selector and part attribute to style shadowDOM parts: developer.mozilla.org/en-US/docs/Web/CSS/::part Commented May 7 at 8:29
  • I think so too, because the button does have a part attribute ... Commented May 7 at 14:55
  • 1
    i don't know if it's a de-facto standard documentation but here's one analyzer that supports that jsdoc field custom-elements-manifest.open-wc.org/analyzer/getting-started/… Commented May 9 at 3:04
  • Oooooh ... OK ... It makes sense now ... It's part of the manifest analyzer ... Lit includes that as part of its tooling ... Cool Thanks!! Commented May 9 at 14:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.