Next.js Discord

Discord Forum

Eliminate previous styles from higher level layouts when accessing a lower level one

Australian Freshwater Crocodile posted this in #help-forum
Open in Discord
Australian Freshwater CrocodileOP
There is a problem. Let's say I have this folder structure on the image.
Now let's say I access the ""
Now I am in "layout.tsx -> layout.tsx -> page.tsx" right?

Now from that page. Let's say I click a "Link" element that redirects to ""

The problem here is that the style "globalsMainWebsite.scss" that was imported inside "app(main website)\layout.tsx" is not eliminated. The style doesn't exist when I access "" directly because it is never imported...

Basically, how do I clear the style with the Link component? Is there something I don't know?

3 Replies

Lesser Goldfinch
The folder structure seems wrong
Australian Freshwater CrocodileOP
How so? what can I change?
Australian Freshwater CrocodileOP
@Lesser Goldfinch sorry, what do you think is wrong