Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize Twitter Bootstrap Classnames

http://getbootstrap.com/customize/

Above link, customizes Bootstrap's components, Less variables, and jQuery plugins to get your very own version.

I am wondering if it's possible to customize bootstrap by adding prefixes to it's classes, for example:

".container" = ".myid_container"
".btn-group" = ".myid_btn-group"
like image 619
alyssaeliyah Avatar asked Mar 12 '15 06:03

alyssaeliyah


2 Answers

You can @extend bootstrap classes and call them whatever you want if you are using sass. Here is the info http://www.sitepoint.com/sass-semantically-extend-bootstrap/

But if you use plain bootstrap.css I'm not sure if there is a way to rename bootstrap classes except for renaming them in the file.

like image 58
iurii Avatar answered Oct 01 '22 19:10

iurii


I know this is an old question, but this may help people coming here from search engines - you can do the following in scss to achieve the above:

// allows this file to use bootstrap classes and functions
@forward "node_modules/bootstrap/scss/bootstrap";

.myid_container{
  @extend .container;
}

.myid_btn-group{
  @extend .btn-group;
}
like image 34
Kingo Avatar answered Oct 01 '22 21:10

Kingo