You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add Nextra to an existing Next.js application just to build the docs under the /pages/docs folder. I've set the base path to basePath: '/docs' (not sure what that did actually) and imported the styling import 'nextra-theme-docs/style.css' in _app.js. This worked fine but of course overrode the non-docs styling through my whole application. So I moved the .css import to the top of my /docs/index.mdx instead, this worked at first, but if I navigate to docs and then navigate back the styling persists and overrides my styles again.
Is there any way to scope the CSS to only the /docs pages?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to add Nextra to an existing Next.js application just to build the docs under the /pages/docs folder. I've set the base path to
basePath: '/docs'
(not sure what that did actually) and imported the stylingimport 'nextra-theme-docs/style.css'
in _app.js. This worked fine but of course overrode the non-docs styling through my whole application. So I moved the .css import to the top of my /docs/index.mdx instead, this worked at first, but if I navigate to docs and then navigate back the styling persists and overrides my styles again.Is there any way to scope the CSS to only the /docs pages?
Beta Was this translation helpful? Give feedback.
All reactions