Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Twind Configuration no funciona con LitElement

Parece que no puedo hacer que el tema funcione con LitElement. Puedo configurar los otros elementos de configuración sin problema, pero Twind no reconoce el tema. También vale la pena mencionar que no recibo ningún error al compilar. ¿Alguien tiene una solución rápida?

 import {LitElement, html} from 'lit'; import {setup, warn, create, cssomSheet} from 'twind'; setup({ mode: warn, theme: { colors: { purple: '#2013', }, }, }); const sheet = cssomSheet({target: new CSSStyleSheet()}); const {tw} = create({sheet}); export class MyApp extends LitElement { static styles = [sheet.target]; static get properties() { return { name: {type: String}, }; } constructor() { super(); this.name = 'World'; } render() { return html` <h1 class="${tw`text(3xl purple)`}">${this.name}!</h1> `; } } window.customElements.define('my-app', MyApp);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probablemente, el problema es el shadow-dom. Si puede usar Twind, puede intentar renderizar a light-dom, en lugar de shadow-dom.

Para usar light-dom, agregue este método en su clase de componente web:

 createRenderRoot() { return this; }

Por otro lado, no estoy seguro de que funcione sin Lit...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!