Skip to content

Commit c06428a

Browse files
committed
refactor(styles): migrate to Sass modules, cleanup
1 parent 185da89 commit c06428a

File tree

7 files changed

+33
-50
lines changed

7 files changed

+33
-50
lines changed

Diff for: angular.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"allowedCommonJsDependencies": [],
4545
"stylePreprocessorOptions": {
4646
"sass": {
47-
"silenceDeprecations": ["import"]
47+
"silenceDeprecations": []
4848
}
4949
}
5050
},

Diff for: src/scss/_custom.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Here you can add other styles
22

33
// custom .chartjs-tooltip-body-item padding
4-
@import "charts";
4+
@use "charts";
55

66
// custom tweaks for scrollbar styling (wip)
7-
@import "scrollbar";
7+
@use "scrollbar";
88

99
// custom calendar today cell color
1010
.calendar-cell.today {

Diff for: src/scss/_examples.scss

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/* stylelint-disable declaration-no-important, scss/selector-no-redundant-nesting-selector */
2-
$enable-deprecation-messages: false; /* stylelint-disable-line scss/dollar-variable-default */
1+
@use "@coreui/coreui/scss/variables" as *;
2+
@use "@coreui/coreui/scss/mixins/breakpoints" as *;
3+
@use "@coreui/coreui/scss/mixins/color-mode" as *;
34

45
.example {
56
&:not(:first-child) {
@@ -8,7 +9,6 @@ $enable-deprecation-messages: false; /* stylelint-disable-line scss/dollar-varia
89

910
.tab-content {
1011
background-color: var(--#{$prefix}tertiary-bg);
11-
//background-color: rgba(var(--#{$prefix}tertiary-bg-rgb), var(--#{$prefix}bg-opacity, 1)) !important;
1212
}
1313

1414
& + p {
@@ -107,3 +107,9 @@ $enable-deprecation-messages: false; /* stylelint-disable-line scss/dollar-varia
107107
}
108108
}
109109
}
110+
111+
@include color-mode(dark) {
112+
.example .tab-content {
113+
background-color: var(--#{$prefix}secondary-bg);
114+
}
115+
}

Diff for: src/scss/_scrollbar.scss

-18
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,3 @@
2828
background: #444;
2929
}
3030

31-
.dark-theme::-webkit-scrollbar-thumb {
32-
background: var(--cui-gray-600, #444);
33-
}
34-
35-
.dark-theme::-webkit-scrollbar-thumb:hover {
36-
background: var(--cui-gray-400, #999);
37-
}
38-
39-
.ng-scroll-content {
40-
display: flex !important;
41-
}
42-
43-
.ng-scrollbar:not(.overflow) .ng-scrollbar-wrapper[verticalused="false"] {
44-
//background-color: #e797a5;
45-
.ng-scroll-viewport {
46-
display: flex;
47-
}
48-
}

Diff for: src/scss/_theme.scss

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
@use "@coreui/coreui/scss/mixins/transition" as *;
2+
@use "@coreui/coreui/scss/mixins/color-mode" as *;
3+
14
body {
25
background-color: var(--cui-tertiary-bg);
36
}
47

58
.wrapper {
69
width: 100%;
7-
@include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0));
8-
@include ltr-rtl("padding-right", var(--cui-sidebar-occupy-end, 0));
10+
padding-inline: var(--cui-sidebar-occupy-start, 0) var(--cui-sidebar-occupy-end, 0);
911
will-change: auto;
1012
@include transition(padding .15s);
1113
}
@@ -33,13 +35,13 @@ body {
3335
}
3436

3537
.sidebar-toggler {
36-
@include ltr-rtl("margin-left", auto);
38+
margin-inline-start: auto;
3739
}
3840

3941
.sidebar-narrow,
4042
.sidebar-narrow-unfoldable:not(:hover) {
4143
.sidebar-toggler {
42-
@include ltr-rtl("margin-right", auto);
44+
margin-inline-end: auto;
4345
}
4446
}
4547

@@ -51,14 +53,12 @@ body {
5153
min-height: calc(3rem + 1px); // stylelint-disable-line function-disallowed-list
5254
}
5355

54-
@if $enable-dark-mode {
55-
@include color-mode(dark) {
56-
body {
57-
background-color: var(--cui-dark-bg-subtle);
58-
}
56+
@include color-mode(dark) {
57+
body {
58+
background-color: var(--cui-dark-bg-subtle);
59+
}
5960

60-
.footer {
61-
--cui-footer-bg: var(--cui-body-bg);
62-
}
61+
.footer {
62+
--cui-footer-bg: var(--cui-body-bg);
6363
}
6464
}

Diff for: src/scss/_variables.scss

-5
This file was deleted.

Diff for: src/scss/styles.scss

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/* You can add global styles to this file, and also import other style files */
22

3-
// If you want to override variables do it here
4-
@import "variables";
5-
63
// Import styles with default layout.
7-
@import "@coreui/coreui/scss/coreui";
4+
@use "@coreui/coreui/scss/coreui" as * with (
5+
$enable-deprecation-messages: false
6+
);
87

98
// Import Chart.js custom tooltips styles
10-
@import "@coreui/chartjs/scss/coreui-chartjs";
9+
@use "@coreui/chartjs/scss/coreui-chartjs";
1110

1211
// Custom styles for this theme
13-
@import "theme";
12+
@use "theme";
1413

1514
// Some temp fixes
16-
//@import "fixes";
15+
//@use "fixes";
1716

1817
// If you want to add custom CSS you can put it here.
19-
@import "custom";
18+
@use "custom";
2019

2120
// Examples
2221
// We use those styles to show code examples, you should remove them in your application.
23-
@import "examples";
22+
@use "examples";
23+

0 commit comments

Comments
 (0)