How to get the Primary/Secondary color in jQuery UI Theme
Posted
by simonsanderson
on Stack Overflow
See other posts from Stack Overflow
or by simonsanderson
Published on 2009-06-29T07:58:57Z
Indexed on
2010/04/06
6:03 UTC
Read the original article
Hit count: 149
Is there a way to reference the colours used in the jQuery themes without creating a simple style for each theme that I may choose to use?
Example: I have some text as follows
<div>Hello</div>
which I'd like to be change colour in line with my theme of the day. I wish to use the primary colour from a theme (say ui-lightness) which is "#1c94c4" as defined in several of the styles such as ui-state-default in ui-lightness.css
The problem is that if I do the following
<div class='ui-state-default'>Hello</div>
I get all the other style effects, like borders and background colour, which are not right for my application What I'd like to do is something like
<div class='ui-primary-color'>Hello</div>
which would automatically change only the colour dependent on the theme.
PS. Doing a pre-build pre-processing step to parse the themes and generate a customised css style would be my least favourable option here!
© Stack Overflow or respective owner