Create such a scss file structure,
- vendors - bootstrap - stylesheets - _bootstrap.scss - scss - themes - _theme-1.scss - _theme-2.scss - _variables.scss - styles.scss - portal-1.scss - portal-2.scss
_variables.scss
@import "../vendors/bootstrap/stylesheets/bootstrap/variables"; @import "../vendors/bootstrap/stylesheets/bootstrap/mixins";
styles.scss
@import "variables"; @import "../vendors/bootstrap/stylesheets/bootstrap";
themes /_theme-1.scss
@import "../variables"; /* change value bootstrap and custom default variables ... */ $brand-primary:
themes /_theme-2.scss
@import "../variables"; /* change value bootstrap and custom default variables ... */ $brand-primary:
Portal 1.scss
@import "themes/_theme-1"; .portal-1 { @import "../vendors/bootstrap/stylesheets/bootstrap/buttons"; @import "../vendors/bootstrap/stylesheets/bootstrap/alerts"; }
Portal-2.scss
@import "themes/_theme-2"; .portal-2 { @import "../vendors/bootstrap/stylesheets/bootstrap/buttons"; @import "../vendors/bootstrap/stylesheets/bootstrap/alerts"; }
After compiling sass, we get 3 styles.css, portal-1.css and portal-2.css files. Use style.css by default, and others in the head tag for the theme.
<html> <head> <link href="styles.css" rel="stylesheet" /> <link href="portal-1.css" rel="stylesheet" /> </head> <body> <button class="btn btn-primary">BUTTON</button> <div class="portal-1"> <button class="btn btn-primary">BUTTON</button> </div> </body> </html>
source share