0

The npm package that I use have a few themes. Lets say its an table view package.

I want set this themes on admin panel. If the admin desire table to be displayed in dark mode. When its changed on settings page, I want that spesific .css file to be injected for the table component. I found a solution that I injected in the table component by reading settings data via my api but it didnt feel good.

Is there any way to inject theme css files at /node-modules/theme/light.css and dark.css in runtime without injecting them into document head on init method. I couldn't find any.

btw, I am using scss in the project.

Load css file dynamically for theming I found a solution similar to the one here, but I want to assign a theme to a global variable and act accordingly. I want to render by getting setting vars before loading the page without using Document.

I can change themes as lazy loading onInit via SettingsService but I'm not sure it's best practice

Balkan
  • 21
  • 2

0 Answers0