Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:08:47+00:00 2026-06-10T12:08:47+00:00

jQueryUI provides a convenient css framework: http://jqueryui.com/docs/Theming/API Just by using jQueryUI’s CSS classes (ui-widget-content,

  • 0

jQueryUI provides a convenient css framework: http://jqueryui.com/docs/Theming/API

Just by using jQueryUI’s CSS classes (ui-widget-content, ui-widget-header, etc), you can easily create html-snippets that are themeable via http://jqueryui.com/ThemeRoller

A feature what I’m sometimes missing in designing my apps, is to reuse a css property from jquery-UI’s CSS classes, but not all of the properties. Simple reuse is possible by using none !important.

For example, when you only want to get the foreground color of .ui-widget-content without backgrounds or borders, you could just do:

<style>
.no-background { background: none !important; }
.no-border { border: none !important; }
</style>
<div class="ui-widget-content no-background no-border">
  hi world :)
</div>

But, is there a simple way to get the background-color of .ui-widget-header and reuse it in my own CSS classes as color ?

I made a somewhat quick and dirty solution for this: filling a style tag using JavaScript and DOM manipulation.

JSBin: http://jsbin.com/ijuxar/7/edit

HTML Code:

<style class="computedStyles"></style>
<div class="cssHelper ui-helper-hidden-accessible" style="visibility: hidden">
  <div class="ui-widget-header"></div>
  <div class="ui-widget-content"></div>
  <div class="ui-state-default"></div>
  <div class="ui-widget-header ui-state-active"></div>
  <div class="ui-widget-header ui-state-hover"></div>
</div>
<h1 class="ui-color-2">Hi World</h1>

JS Code:

$(document).ready(function () {
  var css= '', i, colors = [
      $('.cssHelper .ui-widget-content').css('color'),
      $('.cssHelper .ui-widget-header').css('background-color'),
      $('.cssHelper .ui-state-hover').css('background-color'),
      $('.cssHelper .ui-state-default').css('background-color'),
      $('.cssHelper .ui-widget-header.ui-state-active').css('background-color')
  ];
  for (i = 0; i < colors.length; i += 1) {
      css += '.ui-color-' + (i + 1) + ' { color: ' + colors[i] + '}\n';
  }
  $('style.computedStyles:first').text(css);
});

I feel that the JavaScript solution is somewhat evil. Furthermore, it causes a FOUC in some browsers.

Is it possible to get it done with plain CSS and/or with serverside tools (SASS/LESS/…)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:08:49+00:00Added an answer on June 10, 2026 at 12:08 pm

    CSS stands for Cascading Style Sheets. which means styles set by classes will “cascade”

    So if you have your own css file, and include it AFTER the jquery css. It will over ride the jquery css. Likewise, if you attach 2 classes to an html element, the 2nd classes styles will over-write the first ones.

    the other way to over write specific styles of a css class, is to use the !important indicator on your css. something marked !important will not be over written by something that isn’t no matter what order they appear in.

    So to answer your question. In your own css file, have your class that specifies the color like so:

    .myColour{
        background-:none!important;
        border:none!important;
    }
    

    and class your element like so:

    <div class="ui-widget-content myColour" >
      hi world :)
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jquery UI Drag and Drop ( http://jqueryui.com/demos/draggable ) together with https://github.com/furf/jquery-ui-touch-punch
http://jqueryui.com/demos/accordion/ You can do $('#itename').accordion('activate', 0) to make an accordion closed but that'll change
According to http://jqueryui.com/demos/tabs , tabs that load content via AJAX will show Loading... while
I want this: http://jqueryui.com/demos/dialog/#modal-message to happend when you click on ClickMe. how to do
(Citing source at: http://jqueryui.com/demos/dialog/#modal-form ) As an example, this works great but each time
Example: http://jqueryui.com/demos/dialog/#modal-confirmation The example shown allows you to view the source and even has
I have exactly the same problem as described here: http://bugs.jqueryui.com/ticket/7930 . The problem is
I'm using the jQueryUI accordion widget to provide the functionality I need. I'm not
I m havin a jqueryui modal form. and i m using jquery cluetip tool
When I load jQueryUI on a Windows XP machine using Firefox 3.6.3, I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.