Results 1 to 3 of 3

Thread: Setting CSS variables at runtime using Fashion.css.setVariables not working

  1. #1

    Default Setting CSS variables at runtime using Fashion.css.setVariables not working

    Hello


    I have a modern ExtJS 6.2.1 application packaged using Cordova for Android. The project is configured to use CrossWalk (Chromium) as WebView and theme-material as theme.


    I include css-vars.js in index.html like this:


    Code:
    <script type="text/javascript" src="modern/resources/css-vars.js">  </script>
    So, the class "Fashion" is defined at run-time, and the following call returns true:


    Code:
    var tt=Ext.theme.Material.hasFashion();


    The problem is that when I call "setVariables" function like this:




    Code:
    Fashion.css.setVariables({
                    'base-color': 'red'
                });


    nothing happens, and no error is given on the console. Also, this function call:




    Code:
    Ext.theme.Material.setDarkMode(true);


    does nothing, as it calls "setVariables" internally.


    What can I do to be able to change the CSS variables at run-time? Why doesn't "setVariables" work? Is it because of Cordova packaging?


    Thanks

  2. #2
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748
    Answers
    55

    Default

    Do you see a CSS selector for ":root" that is applied to the HTML element? Select that element in the Elements tree of the debugger and you should see things like "--base-color: #2196f3;" and many others like it...
    Don Griffin

    "Use the source, Luke!"

  3. #3

    Default

    Quote Originally Posted by dongryphon View Post
    Do you see a CSS selector for ":root" that is applied to the HTML element? Select that element in the Elements tree of the debugger and you should see things like "--base-color: #2196f3;" and many others like it...
    Yes,I can see the :root selector applied to the HTML element, with --base-color any many other variables. But there is a line drawn through them, with a small yellow exclamation mark beside each variable saying: 'unknown property name'

    aaa.png

Similar Threads

  1. Replies: 0
    Last Post: 24 Nov 2016, 7:27 AM
  2. Replies: 3
    Last Post: 30 Dec 2014, 2:59 AM
  3. Possible to pass variables into .sccs file during runtime?
    By bingles in forum Sencha Touch 2.x: Q&A
    Replies: 6
    Last Post: 20 Jun 2012, 7:45 AM
  4. Setting ComboBox 'editable' at runtime working in IE7 but not FF2
    By fay in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 10 Dec 2009, 1:53 PM

Tags for this Thread

Posting Permissions

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