Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1e56fb4ec0
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (23 sloc) 1.426 kb

You don't need to use JavaScript to take advantage of CleanSlate. However, if you do want to manipulate a CleanSlated element with JavaScript, then you will find that you cannot change its styles by manipulating the object, as you might normally. Instead, you will need to edit its property, or change its style attribute.

E.g. = "red"; // won't work = "red !important"; // won't work = "border: red !important"; // WILL work elem.setAttribute("style", "border: red !important"); // WILL work // jQuery(elem).css("border", "red"); // won't work jQuery(elem).css("border", "red !important"); // won't work jQuery(elem).attr("style", "border: red !important"); // WILL work

If you are using jQuery, you can use the "'Important' plugin": to make this process much more easy. With this, you can add true as a third argument to the css() method:

jQuery(elem).css("border", "red", true);

or turn on !important handling by default:

jQuery(elem).css("border", "red");

or make an element's styles use !important:


or not:


...amongst other useful features.

Jump to Line
Something went wrong with that request. Please try again.