Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
targeting a specific descendant element class in tailwind for auto generated nested components from design system?

I am trying to integrate tailwind in a project that requires some customization but mainly uses a lot of components that comes from a existing design systems.

I want to know how to target and element that is generated as a descendant from the main component using tailwind.

Here is an scenario. I have a page element and it has a page-header sub component which we can access but page-header sub component has a nested component with class 'page-header-separator'.

<ds-page>
  <page-header>
    <!-- the item below is created from the design system, wanted to set a style with tailwind from page-header -->
    <page-header-separator>
    </page-header-separator>
  </page-header>
</ds-page>

By the way I am using angular. this is not a suggestion question. I know I can just put this specific selector in the component style. But that is not my point. This is for understanding tailwind.

Question is, how I can set a style from directly from page-header to target page-header-separator?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you would add the needed styles to your main CSS file and not try and apply the styles in the html to the parent.

So normally the first three lines of your css file will be the three directives, and after that you can add the styles targeting the required element.

@tailwind base;
@tailwind components;
@tailwind utilities;

page-header page-header-separator {
  @apply text-2xl text-gray-900;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda