1

I want to use both materialize and bootstrap on my website. Problem is that classes overlap, how can I narrow framework to style only part of website? Or maybe how can I namespace it? I only want to use small subset of materialize (for example cards component) and use bootstrap for general styling (for example grid system.

I am also using bower with grunt, so if the solution goes well with automation process of grunt it will be helpful.

Siguza
  • 21,155
  • 6
  • 52
  • 89
user3002996
  • 329
  • 4
  • 18
  • possible duplicate of [How to namespace Twitter Bootstrap so styles don't conflict](http://stackoverflow.com/questions/13966259/how-to-namespace-twitter-bootstrap-so-styles-dont-conflict) – CBroe May 01 '15 at 01:23

1 Answers1

2

Using any of the preprocessors, like sass, less, or my favorite, stylus, you can easily nest an entire CSS file inside a top level class, effectively namespacing

// stylus
.top-level-class
  .nested-class (or entire file)
    color red

// generating
.top-level-class .nested-class {
  color: red;
}
azium
  • 20,056
  • 7
  • 57
  • 79