Skip to content

Commit

Permalink
feat: add prebuilt custom properties theme (akveo#2977)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg authored and katebatura committed Dec 3, 2021
1 parent 183d32f commit 0d7cc82
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@use '../../../theme/styles/themes';
@use '../../../theme/styles/theming-variables' as *;
@use '../../../theme/styles/theming' as *;
@use '../globals' as *;

$nb-global-styles-on-install: false;

@include nb-install() {
@include nb-auth-global();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

$nb-enabled-themes: (corporate);

@include nb-install() {
@include nb-auth-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

$nb-enabled-themes: (cosmic);

@include nb-install() {
@include nb-auth-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

$nb-enabled-themes: (dark);

@include nb-install() {
@include nb-auth-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

$nb-enabled-themes: (default);

@include nb-install() {
@include nb-auth-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@use '../../../theme/styles/themes';
@use '../../../theme/styles/theming-variables' as *;
@use '../../../theme/styles/theming' as *;
@use '../globals' as *;

$nb-global-styles-on-install: false;

@include nb-install() {
@include nb-bootstrap-global();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

$nb-enabled-themes: (corporate);

@include nb-install() {
@include nb-bootstrap-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

$nb-enabled-themes: (cosmic);

@include nb-install() {
@include nb-bootstrap-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

$nb-enabled-themes: (dark);

@include nb-install() {
@include nb-bootstrap-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

$nb-enabled-themes: (default);

@include nb-install() {
@include nb-bootstrap-global();
}
@include nb-install();
5 changes: 5 additions & 0 deletions src/framework/theme/styles/_theming-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ $nb-custom-statuses: () !default;
$layout-window-mode-max-width: 1920px !default;
$tabset-tab-text-hide-breakpoint: 36rem !default;
$route-tabset-tab-text-hide-breakpoint: 36rem !default;
// If disabled `nb-install` wouldn't produce global theme styles and only install content provided into
// `nb-install` mixin. Used to generate components themes without global theme styles.
// Works only when `$nb-enable-css-custom-properties` mode enabled.
$nb-global-styles-on-install: true !default;

// public variables
$nb-enable-css-custom-properties: true !default !global;
Expand All @@ -32,3 +36,4 @@ $nb-theme: () !global;
$nb-processed-theme: () !global;
$nb-theme-export-mode: false !default !global;
$nb-themes-export: () !global;
$nb-global-styles-on-install: true !default !global;
6 changes: 4 additions & 2 deletions src/framework/theme/styles/core/theming/_install.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@
@mixin nb-install-global-with-css-props() {
@content;

@each $theme-name in register.nb-get-enabled-themes() {
@include nb-install-css-properties($theme-name, register.nb-get-registered-theme($theme-name));
@if (theming-variables.$nb-global-styles-on-install) {
@each $theme-name in register.nb-get-enabled-themes() {
@include nb-install-css-properties($theme-name, register.nb-get-registered-theme($theme-name));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@use '../theming-variables' as *;
@use '../all' as *;

$nb-global-styles-on-install: false;

@include nb-install() {
@include nb-theme-global();
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use '../all';
@use '../all' as *;

$nb-enabled-themes: (corporate);

@include all.nb-install() {
@include all.nb-theme-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use '../all';
@use '../all' as *;

$nb-enabled-themes: (cosmic);

@include all.nb-install() {
@include all.nb-theme-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use '../all';
@use '../all' as *;

$nb-enabled-themes: (dark);

@include all.nb-install() {
@include all.nb-theme-global();
}
@include nb-install();
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use '../all';
@use '../all' as *;

$nb-enabled-themes: (default);

@include all.nb-install() {
@include all.nb-theme-global();
}
@include nb-install();

0 comments on commit 0d7cc82

Please sign in to comment.