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

187
Vistas
how to add some styles for some specific components in scoped css?

I'am writing a component (It doesn't matter whether it is developed with Vue or Angular, because they all have the concept of scoped styles. - vue - Angular ). And let us call it foobar.

Because of scoped styles, a .specific style actually is .specific[foobar-component-id-which-is-generated-randomly], so we don't worry styles for foobar will affect other components or elements of other pages unintentionally.

I don't want to give up the benefit.

However, I use many components provieded by a UI libary, for example, Angular-Material's mat-select.

Although mat-select provide a way to add a style class to it, for example, I can add a specific style class to it by <mat-select [panelClass="specific"].

However, write .specific {width: 500px} in foobar.css will not take effect. Because the element generated from mat-select which finally loaded in the page, (I don't know why), dones't have the property foobar-component-id-which-is-generated-randomly.

Is there any solution under the condition of not using global styles and only changing some specific (not all in my writing component) components' styles?

Thanks a lot.

about 4 years ago · Juan Pablo Isaza
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