vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.1k stars 26.72k forks source link

How to load CSS dynamicaly? #10128

Closed Serhioromano closed 4 years ago

Serhioromano commented 4 years ago

Lets' say I have an application and I use bootswatch styles there. I mean application use twitter Bootstrap markup and I want the user to be able to select any style. I want when user clicks on theme name, it loads this style globally and change look immediately.

Another way to say, lest say I have folder

themes
--material.css
--light.css
--dracula.css

How can I do something like

import './themes/'+ themeName + '.css';

So that when I change variable it reloads a style.

timneutkens commented 4 years ago

Please follow the issue template.

https://github.com/zeit/next.js/issues/new/choose

https://github.com/zeit/next.js/issues/new?template=8.Question_about_next.md

# Question about Next.js

GitHub Issues are reserved for Bug reports and Feature requests. The best place to get your question answered is to post it on https://spectrum.chat/next-js.
balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.