Open jswart opened 5 years ago
The spinner color is only limited that's why we used only Materialize colors. The only thing that you can workaround as of now is to override thru css file.
BLUE("spinner-blue"),
BLUE_ONLY("spinner-blue-only"),
RED("spinner-red"),
RED_ONLY("spinner-red-only"),
YELLOW("spinner-yellow"),
YELLOW_ONLY("spinner-yellow-only"),
GREEN("spinner-green"),
GREEN_ONLY("spinner-green-only");
Why do you limit to materialize colors though? Maybe it could be more useful to let people change to any color code, so that they can properly brand their material app.
While an enum is useful for showing and selecting a single item from a set of colors quickly, it becomes more difficult to override it unless I go through the CSS like you suggested.
In order for a web component like this one to be more reusable, I should be able to set it to any color code from my CSSResources file.
That is an internal implementation of Materialize, but we can update it to have a custom color implementation. I will add this TODO in next release.
So I just want to add that I am not familiar with the Materialize spec. Does that spec say "these are the only colors that are provided"? Is there a specific part of the spec that prevents the expansion of colors? From my perspective, I figured that https://gwtmaterialdesign.github.io would be able to change color to whatever you wanted if you just added a hex code.
This feature request will be added on 2.3 release
The MaterialSpinner class does not allow you to directly
setColor(String)
where String can be any hex color code. It would be great if this were functionality was provided instead of having to use the limited SpinnerColor enumerated constants.A custom MaterialLoader should also allow you to
setColor(String)
in the same manner.