[CLOSED] Label Style / Obtain label color based on theme
Per the attached image,
I have a few ButtonGroups in a toolbar.
Some have button , which, when I changed themes to Default, look great, the labels stay dark.
But when I switch to Slate Theme, the labels stay dark, but the buttons light up and are more visible..
My goal is too somehow set the label StyleSpec to a style class that the buttons use, because they work.
I've tried to FireFox and locate the style: x-btn-text...
But when I try to apply to "Cls="x-btn-text" on the label , it doesn't work.
Any ideas?
RE: [CLOSED] Label Style / Obtain label color based on theme
Hi,
But
when I try to apply to "Cls="x-btn-text" on the label , it doesn't
work.
"x-btn-text"
css rule defines padding and cursor only, it doesn't contain color rule. I am not sure what are you waiting from that rule.
I can recommend to create own css file for Slate theme and attach it to the page when you switch to the Slate
In that file add
Code:
.x-label-value{color: #fff;}
RE: [CLOSED] Label Style / Obtain label color based on theme
Ok, but this only solves the problem for the theme Slate. What about access and all the others? Making a case statement doesn't work. What if I add more themes?
In short, it would be nice if there were a way to obtain these values from a library of sorts, then I could make this dynamic.
Maybe a static theme helper class to pull out values like color?
RE: [CLOSED] Label Style / Obtain label color based on theme
Hi,
How we can divine which theme will be used (you can attach custom theme)? I don't see any other way, only create css file for each theme with your css rules. Theme is css file also. Therefore I don't see a problem attach required css file for each theme
Maybe a static theme helper class to pull out values like color?
What advantages has that helper class compare with css files? Can you provide code mockup how to work with such helper?
RE: [CLOSED] Label Style / Obtain label color based on theme
Sure.
Code:
protected void On_Load()
{
this.page.registerclientscriptblock(typeof(string),string.format("<style>.labelcolor{color:{{0}}}</style>",Ext.net.Theme.CurrentLabelColor));
}
RE: [CLOSED] Label Style / Obtain label color based on theme
Hi,
Hmm, I am not sure how that helper can help you.
You can always to register own style rule using RegisterClientStyleBlock or RegisterClientStyleInclude methods of the ResourceManager. Therefore you can always attach css files which contain required css rules for particular theme
RE: [CLOSED] Label Style / Obtain label color based on theme
It helps because:
1. I can leverage the current themes that come with Coolite.
2. My style can change dynamically, as does the selected style selected by the user.
3. I don't have to keep track of different styles and their respective style sheets/location.
4. If I wanted to create my own user controls that are coolite theme sensitive.
RE: [CLOSED] Label Style / Obtain label color based on theme
Hi,
I don't see how the helper class can solve all those problems. What difference between helper and RegisterClientStyleBlock?
Just I don't understand how the suggested helper should work. May be you can provide more details about helper
RE: [CLOSED] Label Style / Obtain label color based on theme
My goes is simply to pull out values that Coolite Themes store.
Like color for labels.
Right now, if I try to apply "x-btn-text", but it only has css rule defines padding and cursor only..then what style should I use to obtain the text color of a button in a ButtonGroup?
RE: [CLOSED] Label Style / Obtain label color based on theme
Hi,
Button use the following css rule to set text color
As you can see that rule is applied on BUTTON tags only
You have to create separate css rule and apply it when Slate theme is selected. I don't see another way to accomplish your goal. It is standard way
Code:
. x-btn-group .x-label-value{color: #fff;}