0

I'm probably about to regret what I am trying to do, but hear me out. I want to incorporate the bootstrap css libary into an existing drupal theme which powers many sites so I can use bootstrap to generate clean forms. My problem is that I dont want the bootstrap css to negatively affect other portions of my sites. I was trying to find a way to pull out just the elements of bootstrap that I needed, and the 'customize bootstrap' page on getbootstrap.com is great for this. However, it doens't help me keep the bootstrap css 'constrained' to just the areas that I want.

What I really want to do is to use teh bootstrap forms.less file, but with the entire file encapsulated into a parent class (like, .bootstrap), so for example, instead of having rules like this:

fieldset { whatever }

instead, all the rules would look like:

.bootstrap fieldset {whatever}

Of course, its possible for me to go into the bootstrap source and manually edit the files to give them the .bootstrap class, but then I have to manually keep updating my copy of bootstrap whenever an update comes.

My question is, is there a way (using less/sass?) to generate a version of bootstrap that isn't 'global' in scope, so you can say 'these rules only apply to this parent selector'?

Joel
  • 814
  • 2
  • 9
  • 19
  • 1
    Have you tried anything? Anything at all? Done any research into LESS or Sass to see how this might be done? – cimmanon Nov 12 '14 at 19:06
  • 1
    yes there's a way to do this in LESS and Sass. http://stackoverflow.com/questions/11149266/prefixing-all-selectors-for-twitter-bootstrap-in-less – Christina Nov 12 '14 at 19:31
  • sorry guys. i googled, just not well. thank you. – Joel Nov 12 '14 at 20:03

0 Answers0