Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Dark and Light Modes


After doing multiple validations, it seems that dark: attribute is being ignored. So if i use
<h1 class="text-3xl font-bold text-primary dark:text-white">
i will always get text-primary in light and dark mode.

what i want is to define two colors that will work in light and dark mode. Thus:
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">
must give primary(blue) in light mode and white in dark mode.

Is this possible?

Thank you


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi,

Sorry for the late reply. Please refer to https://keenthemes.com/metronic/tailwind/docs/customization/dark-mode guide for setting up the dark mode for your app.

if you need any further assistance please do let us know.

Regards,
Sean



It sounds like Tailwind’s dark mode classes aren’t being applied, which usually happens when dark mode isn’t enabled correctly in your config. You must add "class" as the strategy in tailwind.config.js. Without that, dark:text-white won’t override your light-mode color—similar to how players in need correct controls before special abilities work.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(