How to get primary / secondary color in jQuery UI theme

Is there a way to refer to the colors used in jQuery themes without creating a simple style for each theme I can use?

Example : I have text as follows

<div>Hello</div>

which I would like to change color according to my theme of the day. I want to use the main color from a theme (for example, ui-lightness), which is "# 1c94c4", as defined in several 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, such as borders and background color, which are not suitable for my application. What I would like to do is something like

<div class='ui-primary-color'>Hello</div>

which will automatically change only the theme- specific color.

PS. Doing the preliminary preprocessing step for parsing themes and creating a custom css style would be my least favorable option here!

+3
source share
2 answers
var color = $(".ui-state-default").css("color");

gave me the color: "rgb (255, 255, 255)"

+1
source

Yes, you can add any of the CSS UI directly to any html element, create additional styles in separate classes to handle specific needs, or even redefine the class to get rid of, say, border style. Find jQuery 'ThemeRoller-ready' sites.

jQuery.

jQuery theming .

-1

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


All Articles