Class styles are cloned multiple times when using css modules
Unanswered
Southeastern blueberry bee posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Southeastern blueberry beeOP
I guess this is made so i can override a class specific style from another module, but it makes development really hard when randomly i have an element change style because i imported a component inside another component, which then overrides again the styling i gave, and it also creates duplication in the classes
![Image](https://cdn.discordapp.com/attachments/1156536950153551923/1156536950686232586/image.png?ex=65155478&is=651402f8&hm=1bb29aeec7cf76d28ba2e5937bf67a3ce6bb3303aa89f99d019c16420d6d14fb&)
11 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Southeastern blueberry beeOP
Is there some convention i'm not following or a setting i can enable to disable this multiple import?
?????? what
why aren't style sheets removed when navigating away from a page??
the overridden style comes from the exercise page i visited
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/1936f7e8963ff0f800f5eb4b43bc833c.webp?size=256)
Clown
The styling shouldn't be getting overriden tho. Modules should work exactly the same way as normal css does
The innermost element would still override the property defined by whatever is above it.
Thats just how css works
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Southeastern blueberry beeOP
yes and that makes sense since in the component you are in, you expect the latest css import to be the topmost one, but apparently if you visit another page, the styling of the old page is still retained? i don't understand why this should be
or at least that seems what is happening here
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/1936f7e8963ff0f800f5eb4b43bc833c.webp?size=256)
Clown
I dont seem to be understanding the issue you're facing ig.
If only a part of the page is changing, the parts that are still visible and higher in hierarchy would still remain the same
If only a part of the page is changing, the parts that are still visible and higher in hierarchy would still remain the same
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Southeastern blueberry beeOP
look at the css classes applied to that button i highlighted in the video, and also look at the border left of the button being straight, when i navigate to the exercises page (esercizi) and then come back to the previous page, there are more classes applied to that button, and they overridden the previous style of the component, and now the border is rounded