JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid Need help troubleshooting Grid in Blazor.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #112866
    linda05
    Participant

    How do I handle Smart Grid with dark mode support in web app? The grid should switch seamlessly between light and dark themes based on user settings.

    #112871
    Markov
    Keymaster

    Hi,

    Add the ‘theme’ attribute to the body tag and set it to “dark” to apply the dark theme. To un-apply it, remove the ‘theme’ attribute.

    Alternatively, use the CSS variables API of the components.

    For example:

    
    /* Light theme */
    :root {
      --smart-background: #ffffff;
      --smart-surface: #f9f9f9;
      --smart-border: #ddd;
      --smart-primary: #6610F2;
      --smart-color: #000000;
    }
    
    /* Dark theme */
    .dark {
      --smart-background: #121212;
      --smart-surface: #1e1e1e;
      --smart-border: #333;
      --smart-primary: #00D647;
      --smart-color: #ffffff;
    } 

    Hope this helps.

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.