Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

SCSS Variables not working


I want to use _metronic for my NextJS app with a ReactJS template. I only moved the _metronic folder, and after doing so, I wanted to use the `badge-light` component. However, I encountered the following issues:


--bs-success-light is not defined


When I switch back to the original React setup, it works properly. However, when I use Next.js, the issue persists. Interestingly, when I use the default badge, everything works fine.

pretty sure I already import all the needed scss files like this

import '../src/_metronic/assets/sass/style.scss'
import '../src/_metronic/assets/sass/plugins.scss'
import '../src/_metronic/assets/sass/style.react.scss'

import '../src/_metronic/assets/fonticon/fonticon.css'
import '../src/_metronic/assets/keenicons/duotone/style.css'
import '../src/_metronic/assets/keenicons/outline/style.css'
import '../src/_metronic/assets/keenicons/solid/style.css'


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

We haven't tried combining our React version with NextJs, we will check it and consider using NextJs in future releases if we will see demand.

If you have loaded all of the styles and installed Bootstrap dependency then Bootstrap variable should be defined. However, please note that our React version is a client SPA application then NextJs is a server-side rendered application that renders differently and it might require you to load styles differently.

To connect Bootsrap to NextJs you can refer to this post.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(