Change CSS dynamically with GWT

for example, I have css in test.css below.

.test {

  top:100px;

 }

How can I increase the top property of GWT?

+3
source share
2 answers

eg. You can extract the style of an element and change it. other types of widgets may have different functionality

+2
source

You can store the value in memory and simply set it anytime you need it, by replacing the runtime, which is a built-in GWT function.

@eval userBackground com.module.UserPreferences.getUserBackground();
div {
   background: userBackground;
}

public class UserPreferences {
    public static String getUserBackground() {
        return "#FF0000";
    }
}

Please check the GWT specifications: http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Runtime_substitution

+1
source

Source: https://habr.com/ru/post/1750973/


All Articles