Results 1 to 2 of 2

Thread: How to: Material base-color/accent color/dark-mode dynamically change

  1. #1
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Perth, Western Australia
    Posts
    182
    Answers
    10

    Default How to: Material base-color/accent color/dark-mode dynamically change

    I have followed this: https://www.sencha.com/blog/material...in-ext-js-6-2/
    studied this: https://material.io/guidelines/style...-color-palette

    set up selectfields to enable users to choose dark or light mode & also choose a base-color
    and I have set up a switch that chooses appropriate an accent-color based on their chosen base-color:
    then use this...
    Code:
                    Fashion.css.setVariables({
                        "base-color-name": newColorValue,
                        "accent-color-name": accentColor,
                        "dark-mode":  newTheme == 1   // this would be 'true'
                    });
    I get
    a) lots of warnings: [WRN] => ERROR: COLOR NOT FOUND! <= | did not match any of the material design colors.
    b) no change at all for the Dark / Light change
    c) not much happens on base-color change << this seems to be working OK actually

    mmmmm...

    Where is there a good step by step tutorial on how this is meant to be done. .. Or has anyone out there got this working ??


    Thanks

  2. #2
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Perth, Western Australia
    Posts
    182
    Answers
    10

    Default

    Got it !!

    2 issues

    the fix was to change this: "dark-mode": newTheme == 1 // this would be 'true'

    into this:
    "dark-mode": Number(t) == 1 ? "true" : "false"

Similar Threads

  1. how to change the base color of extjs app base on user
    By nilesh.panmand in forum Ext JS 6.x Q&A
    Replies: 3
    Last Post: 3 Sep 2015, 1:10 AM
  2. Replies: 1
    Last Post: 13 May 2013, 9:37 AM
  3. Theming: picking base-color and some theme color issues
    By pmachner in forum Ext: Discussion
    Replies: 12
    Last Post: 31 Aug 2011, 10:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •