Skip to content

Commit

Permalink
feat(theme): enable CSS custom properties mode by default (#2965)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Custom properties mode is enabled by default.

`@nebular/theme/styles/_components.scss` file removed. Replace imports from this files with:
```
@import 'theming';
@import 'themes';
```

Removes `layout-window-mode-max-width`, `tabset-tab-text-hide-breakpoint`, `route-tabset-tab-text-hide-breakpoint` theme properties. Use `$layout-window-mode-max-width`, `$tabset-tab-text-hide-breakpoint`, `$route-tabset-tab-text-hide-breakpoint` variables instead.
  • Loading branch information
yggg authored Dec 1, 2021
1 parent a0997d2 commit 3a88e9b
Show file tree
Hide file tree
Showing 208 changed files with 1,452 additions and 1,467 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;

@include nb-install-component() {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions docs/app/@theme/components/footer/footer.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

@include nb-install-component() {

$text-fg: nb-theme(footer-text-color);
$icon-color: nb-theme(footer-icon-color);
$title-fg: nb-theme(color-fg-heading);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@import '../../styles/themes';
@use '../../styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

:host {
display: flex;
Expand Down
10 changes: 6 additions & 4 deletions docs/app/@theme/components/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

@include nb-install-component() {

$left-section-width: nb-theme(sidebar-width);
$right-section-width: nb-theme(settings-col-width);
$logo-fg: nb-theme(header-fg);
Expand Down Expand Up @@ -59,9 +59,11 @@
color: $menu-item-fg;
display: block;

&:hover, &.active, &:focus {
&:hover,
&.active,
&:focus {
color: $menu-item-fg-active;
outline: none!important;
outline: none !important;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions docs/app/@theme/components/hero/hero.component.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

@include nb-install-component() {

$shadow: 0 12px 34px rgba(0, 60, 183, 0.25);
$btn-bg: linear-gradient(90deg, #18f297 0%, #00e6e6 100%);
$btn-shadow-hover: 0 18px 34px 0 rgba(0, 60, 183, 0.35);
$btn-shadow-active: inset 0 1px 3px 0 rgba(0, 60, 183, 0.5);
$get-started-fg: #3381ff;
$title-fg: nb-theme(color-fg-heading-light);


width: 100%;
max-width: 100%;
display: flex;
Expand Down Expand Up @@ -175,7 +174,9 @@
}
}

h1,h2,h3 {
h1,
h2,
h3 {
color: $title-fg;
}

Expand Down Expand Up @@ -243,7 +244,6 @@
}

@include media-breakpoint-up(md) {

.block {
font-size: 0.875rem;
}
Expand Down
9 changes: 4 additions & 5 deletions docs/app/@theme/components/icon-card/icon-card.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

@include nb-install-component() {

$shadow-hover: 0 8px 24px 0 rgba(0, 31, 97, 0.07);
$text-fg: nb-theme(color-fg-text);
$title-fg: nb-theme(color-fg-heading);
Expand Down Expand Up @@ -49,8 +49,8 @@
text-align: center;
}

&:hover, &:active {

&:hover,
&:active {
&::before {
opacity: 1;
}
Expand All @@ -71,4 +71,3 @@
padding-right: 1.5rem;
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;

@include nb-install-component() {
display: flex;
Expand Down
3 changes: 1 addition & 2 deletions docs/app/@theme/components/page-toc/page-toc.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;

@include nb-install-component() {

$title-fg: nb-theme(color-fg-heading-light);
$item-fg: rgba(102, 110, 128, 0.87);
$item-fg-active: #202020;
Expand Down
2 changes: 1 addition & 1 deletion docs/app/@theme/components/search/search.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;

@include nb-install-component() {
position: relative;
Expand Down
7 changes: 4 additions & 3 deletions docs/app/@theme/components/text-card/text-card.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../@theme/styles/themes';
@use '../../../@theme/styles/themes' as *;
@use '../../../../../src/framework/theme/styles/globals' as *;

@include nb-install-component() {

$accent-line-bg: linear-gradient(180deg, #3366ff 0%, #7396ff 100%);
$title-fg: nb-theme(color-fg-heading);
$text-fg: nb-theme(color-fg-text);
Expand All @@ -21,7 +21,8 @@
border-right: 1px solid #d9e4ff;
}

&:nth-child(1), &:nth-child(2) {
&:nth-child(1),
&:nth-child(2) {
border-bottom: 1px solid #d9e4ff;
}
}
Expand Down
8 changes: 5 additions & 3 deletions docs/app/@theme/styles/_common.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@mixin nbd-common() {
@use 'themes' as *;

@mixin nbd-common() {
.ds-dropdown-menu {
box-shadow: nb-theme(shadow);
border-radius: nb-theme(border-radius);
Expand All @@ -14,7 +15,7 @@
}
}

.ds-dropdown-menu [class^=ds-dataset-] {
.ds-dropdown-menu [class^='ds-dataset-'] {
border: none;
}
}
Expand All @@ -28,7 +29,8 @@
background-color: transparent;
}

.visually-hidden { /* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility */
.visually-hidden {
/* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility */
position: absolute !important;
height: 1px;
width: 1px;
Expand Down
5 changes: 4 additions & 1 deletion docs/app/@theme/styles/hs-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@use 'themes' as *;

@mixin hs-custom-form() {
.hs-custom-form {
.modal-header {
Expand Down Expand Up @@ -45,7 +47,8 @@
padding: 0;
}

.hs-form-required, .hs-error-msg {
.hs-form-required,
.hs-error-msg {
margin-top: 0.5rem;
color: nb-theme(text-danger-color);
}
Expand Down
3 changes: 2 additions & 1 deletion docs/app/@theme/styles/pace.theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin ngd-pace-theme() {
@use 'themes' as *;

@mixin ngd-pace-theme() {
.pace .pace-progress {
background: nb-theme(color-fg-highlight);
}
Expand Down
30 changes: 15 additions & 15 deletions docs/app/@theme/styles/styles.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@import 'themes';
@import 'common';
@use 'themes' as *;
@use 'common';

@import 'pace.theme';
@use 'pace.theme';

@import '../../../../src/framework/theme/styles/global/normalize';
@import '../../../../src/framework/theme/styles/global/components';
@import '../../../../src/framework/theme/styles/global/typography/typography';
@import '../../../../src/framework/bootstrap/styles/globals';
@import './hs-form';
@use '../../../../src/framework/theme/styles/global/normalize';
@use '../../../../src/framework/theme/styles/global/components' as *;
@use '../../../../src/framework/theme/styles/global/typography/typography';
@use '../../../../src/framework/bootstrap/styles/globals' as bootstrap-globals;
@use 'hs-form';

@include nb-install() {
@include nb-layout-theme();
Expand All @@ -16,28 +16,28 @@
@include nb-menu-theme();
@include nb-actions-theme();
@include nb-search-theme();
@include nb-bootstrap-global();
@include bootstrap-globals.nb-bootstrap-global();
@include nb-icon-theme();
@include nb-input-theme();
@include nb-typography();
@include typography.nb-typography();
@include nb-buttons-theme();
@include nb-select-theme();
@include nb-option-list-theme();
@include nb-input-theme();
@include nb-overlay-theme();
@include nb-spinner-theme();

@include nbd-common();
@include common.nbd-common();

// loading progress bar
@include ngd-pace-theme();
@include pace.ngd-pace-theme();

@include hs-custom-form();
};
@include hs-form.hs-custom-form();
}

body {
scrollbar-face-color: rgba(0, 0, 0, 0.3);
scrollbar-track-color: rgba(255, 255, 255, 0.7);
min-width: 320px!important;
min-width: 320px !important;
-webkit-font-smoothing: antialiased;
}
Loading

0 comments on commit 3a88e9b

Please sign in to comment.