I am attempting to do the following:
.bootstrap-scope {
@import "bootstrap.min.css";
}
I know bootstrap.min.css is in the proper place because placing @import "bootstrap.min.css"; at the top of the css page works fine.
Anyways, the point is to be able to scope out what is affected by bootstrap. I would like bootstrap to only be applied to the enclosing div
<div class="bootstrap-scope">
...
</div>
Any ideas? This seems like it should be straightforward.
this post suggested to put the import inside a class.. Are there any alternatives?
You cannot @import inside a CSS rule. @import statements must be declared outside any selectors.
The
@importCSS at-rule allows to import style rules from other style sheets. These rules must precede all other types of rules, except@charsetrules; as it is not a nested statement, it cannot be used inside conditional group at-rules.
You would have to write such a thing in LESS or SASS, and preprocess it into CSS.
Your linked question suggests creating a LESS file that import Bootstrap's LESS code, and then compile that to CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With