UNPKG

6.06 kBSCSSView Raw
1/**
2 * @license
3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 */
6
7@mixin window-mode($padding-top) {
8 padding-top: $padding-top;
9
10 nb-layout-header.fixed {
11 top: $padding-top;
12 }
13
14 nb-layout-header.fixed ~ .layout-container nb-sidebar .main-container-fixed {
15 height: calc(100vh - #{$padding-top} - #{nb-theme(header-height)});
16 top: calc(#{$padding-top} + #{nb-theme(header-height)});
17 }
18
19 nb-sidebar.fixed {
20 left: calc((100vw - #{nb-theme(layout-window-mode-max-width)}) / 2);
21 }
22
23 .layout .layout-container {
24 nb-sidebar.fixed.right {
25 right: calc((100vw - #{nb-theme(layout-window-mode-max-width)}) / 2);
26 }
27
28 nb-sidebar.fixed {
29 top: calc(#{nb-theme(header-height)} + #{$padding-top});
30 }
31 }
32
33 .scrollable-container {
34 height: calc(100vh - #{$padding-top});
35 box-shadow: nb-theme(layout-window-shadow);
36 }
37}
38
39@mixin nb-layout-theme() {
40
41 nb-layout .scrollable-container {
42 @include nb-scrollbars(
43 nb-theme(layout-scrollbar-color),
44 nb-theme(layout-scrollbar-background-color),
45 nb-theme(layout-scrollbar-width));
46 }
47
48
49 nb-layout.with-scroll .scrollable-container {
50 overflow: auto;
51 height: 100vh;
52 display: block;
53
54 @include media-breakpoint-down(sm) {
55 overflow-y: scroll;
56 -webkit-overflow-scrolling: touch;
57 }
58 }
59
60 .layout {
61 min-width: nb-theme(layout-window-mode-min-width);
62 }
63
64 nb-layout.window-mode {
65
66 background: nb-theme(layout-window-mode-background-color);
67 display: block;
68
69 .scrollable-container {
70 max-width: nb-theme(layout-window-mode-max-width);
71 margin: 0 auto;
72 }
73
74 .layout nb-layout-header {
75 max-width: nb-theme(layout-window-mode-max-width);
76 margin-left: auto;
77 margin-right: auto;
78 width: 100%;
79
80 nav {
81 max-width: nb-theme(layout-window-mode-max-width);
82 margin: 0 auto;
83 }
84 }
85
86 @media screen and (min-width: nb-theme(layout-window-mode-max-width) + 20px) {
87 $padding-top: nb-theme(layout-window-mode-padding-top) / 4;
88
89 @include window-mode($padding-top);
90
91 nb-layout.with-scroll {
92 .scrollable-container {
93 height: calc(100vh - #{$padding-top});
94 }
95 }
96 }
97
98 @media screen and (min-width: nb-theme(layout-window-mode-max-width) + 150px) {
99 $padding-top: nb-theme(layout-window-mode-padding-top) / 2;
100
101 @include window-mode($padding-top);
102
103 nb-layout.with-scroll {
104 .scrollable-container {
105 height: calc(100vh - #{$padding-top});
106 }
107 }
108 }
109
110 @media screen and (min-width: nb-theme(layout-window-mode-max-width) + 300px) {
111 $padding-top: nb-theme(layout-window-mode-padding-top);
112
113 @include window-mode($padding-top);
114
115 nb-layout.with-scroll {
116 .scrollable-container {
117 height: calc(100vh - #{$padding-top});
118 }
119 }
120 }
121 }
122
123 nb-layout .layout {
124 background-color: nb-theme(layout-background-color);
125 color: nb-theme(layout-text-color);
126 font-family: nb-theme(layout-text-font-family);
127 font-size: nb-theme(layout-text-font-size);
128 font-weight: nb-theme(layout-text-font-weight);
129 line-height: nb-theme(layout-text-line-height);
130 min-height: nb-theme(layout-min-height);
131
132 .layout-container {
133
134 nb-sidebar {
135 &.fixed,
136 .main-container-fixed {
137 top: nb-theme(header-height);
138 }
139 }
140
141 .content {
142
143 nb-layout-footer {
144 box-shadow: nb-theme(footer-shadow);
145
146 nav {
147 background-color: nb-theme(footer-background-color);
148 border-top: nb-theme(footer-divider-width) nb-theme(footer-divider-style) nb-theme(footer-divider-color);
149 color: nb-theme(footer-text-color);
150 font-family: nb-theme(footer-text-font-family);
151 font-size: nb-theme(footer-text-font-size);
152 font-weight: nb-theme(footer-text-font-weight);
153 line-height: nb-theme(footer-text-line-height);
154 padding: nb-theme(footer-padding);
155
156 a {
157 color: nb-theme(footer-text-highlight-color);
158
159 @include hover-focus-active {
160 color: nb-theme(footer-text-highlight-color);
161 }
162 }
163 }
164 }
165
166 &.center {
167 width: nb-theme(layout-content-width);
168 flex: 0 100 nb-theme(layout-content-width) !important;
169 }
170
171 .columns nb-layout-column {
172 padding: nb-theme(layout-padding);
173
174 @include media-breakpoint-down(md) {
175 padding: nb-theme(layout-medium-padding);
176 }
177
178 @include media-breakpoint-down(sm) {
179 padding: nb-theme(layout-small-padding);
180 }
181 }
182 }
183 }
184 }
185
186 nb-layout-header {
187 background-color: nb-theme(header-background-color);
188 color: nb-theme(header-text-color);
189 font-family: nb-theme(header-text-font-family);
190 font-size: nb-theme(header-text-font-size);
191 font-weight: nb-theme(header-text-font-weight);
192 line-height: nb-theme(header-text-line-height);
193
194 nav {
195 color: nb-theme(header-text-color);
196 box-shadow: nb-theme(header-shadow);
197 height: nb-theme(header-height);
198 padding: nb-theme(header-padding);
199
200 a {
201 color: nb-theme(header-text-color);
202
203 @include hover-focus-active {
204 color: nb-theme(header-text-color);
205 }
206 }
207 }
208
209 & ~ .layout-container {
210 min-height: calc(#{nb-theme(layout-min-height)} - #{nb-theme(header-height)});
211 }
212
213 &.fixed ~ .layout-container {
214 padding-top: nb-theme(header-height);
215 min-height: nb-theme(layout-min-height);
216 }
217
218 &.fixed ~ .layout-container nb-sidebar .main-container {
219 height: calc(#{nb-theme(sidebar-height)} - #{nb-theme(header-height)});
220 }
221 }
222
223 nb-layout.with-subheader {
224 nb-sidebar .main-container {
225 box-shadow: none; // so that we don't have a shadow over the header in this mode
226 }
227 }
228}