Skip to content

Instantly share code, notes, and snippets.

@rabu81
Created May 31, 2012 08:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rabu81/2841808 to your computer and use it in GitHub Desktop.
Save rabu81/2841808 to your computer and use it in GitHub Desktop.
overwrite chosen styling to look like bootstrap
/*
* add this to your own css file,
* to overwrite the _chosen_ styling, to look more like bootstrap!
*
* note: for the error part to work, an .error class-name must be added
* to a wrapping DIV, to display the bootstrap error styling. I have
* just use the wrapping .control-group DIV
*
* credit: Rasmus Burkal, @rabu81
*/
ul.chzn-choices {
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
div.error div.controls div.chzn-container ul.chzn-choices {
border-color: #B94A48;
}
div.error div.controls div.chzn-container-active ul.chzn-choices {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(185, 74, 72, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(185, 74, 72, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(185, 74, 72, 0.6);
}
div.controls ul.chzn-choices {
border-color: #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
div.chzn-container-active ul.chzn-choices {
border-color: rgba(82, 168, 236, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment