A
A
Anon33632020-10-08 06:18:45
css
Anon3363, 2020-10-08 06:18:45

Is it possible to change the style of a component depending on where it is imported?

It is necessary that one component assigns one style when imported, and another style works when imported on another page. But for the styles to be in one file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Olga Grabko, 2016-01-28
@webquestions

codepen.io/anon/pen/OMZzEy
if you can use calc(), :after{} and vw

A
alex4answ, 2020-10-08
@alex4answ

It is possible, but it smacks of the "spaceship" component, it can do everything, it does everything, it looks different.
Decompose, include / change styles in the parent component, or look for other options, because your approach smells

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question