Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
Angular-cli adding styles from external url

Is there way to load css styles from an external url?

For example, I have domain.eu but on my site in sub.domain.eu. I want to use styles which are stored in this domain. (These styles are common for all sites).

Example below is not working for sure.

"styles": [
    "styles.css",
    "http://domain.eu/themes/css/common.css"
  ],

Problem is that webpack is trying to bundle this styles. He cannot retrieve it. When I import it via css

@import('url');

It will not breakdown but it will have problem with missing assets like images or fonts.

Only solution is to add external css style into index.hml. But it is possible to set this value dynamically?

When we have three different themes which defines basic fonts, styles of headers and so on and I want to change it for example by route or basic select option element inside some component is there some kind of hack or something I can do it?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

yes you can add style using external css like styleUrls: ['file name.css'] in your @Component

about 4 years ago · Santiago Trujillo Relatório

0

You are using

"styles": [ "styles.css", "http://domain.eu/themes/css/common.css"]

it is used to write direct css for the respective component but if you want to include some css from other files then you should use like this

styleUrls: [ 'styles.css', 'http://domain.eu/themes/css/common.css' ]

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda