Skip to content

Commit c67063b

Browse files
committed
- fix(scss): new mobile breakpoint variables
```scss // Breakpoints for mobile defaults: $breakpoint-mobile-up: lg !default; $breakpoint-mobile-down: md !default; ``` usage: to shift mobile breakpoint in your template: 1. override `_variables.scss` ```scss $breakpoint-mobile-up: md; $breakpoint-mobile-down: sm; ``` 2. and complementary changes in `index.html` - body: `sidebar-lg-show` -> `sidebar-md-show` - mobile sidebar toggler button: `d-lg-none` -> `d-md-none` - sidebar toggler button: - `d-md-down-none` -> `d-sm-down-none` - `data-toggle="sidebar-lg-show"` -> `data-toggle="sidebar-md-show"`
1 parent 0734ca6 commit c67063b

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
lines changed

scss/_header.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
background-color: rgba(0, 0, 0, .075);
115115
}
116116

117-
@include media-breakpoint-up(lg) {
117+
@include media-breakpoint-up($breakpoint-mobile-up) {
118118
.brand-minimized {
119119
.app-header {
120120
.navbar-brand {

scss/_layout.scss

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ html[dir="rtl"] {
6767
}
6868
}
6969

70-
@include media-breakpoint-up(lg) {
70+
@include media-breakpoint-up($breakpoint-mobile-up) {
7171
//
7272
// Header
7373
//
@@ -256,9 +256,17 @@ html[dir="rtl"] {
256256
}
257257
}
258258
&.sidebar-minimized {
259-
.main,
260-
.app-footer {
261-
margin-left: if($breakpoint != "lg" and $breakpoint != "xl", $sidebar-width, $sidebar-minimized-width);
259+
@include media-breakpoint-down($breakpoint-mobile-down) {
260+
.main,
261+
.app-footer {
262+
margin-left: $sidebar-width;
263+
}
264+
}
265+
@include media-breakpoint-up($breakpoint-mobile-up) {
266+
.main,
267+
.app-footer {
268+
margin-left: $sidebar-minimized-width;
269+
}
262270
}
263271
}
264272
}
@@ -320,9 +328,17 @@ html[dir="rtl"] {
320328
}
321329
}
322330
&.sidebar-minimized {
323-
.main,
324-
.app-footer {
325-
margin-right: if($breakpoint != "lg" and $breakpoint != "xl", $sidebar-width, $sidebar-minimized-width);
331+
@include media-breakpoint-down($breakpoint-mobile-down) {
332+
.main,
333+
.app-footer {
334+
margin-left: $sidebar-width;
335+
}
336+
}
337+
@include media-breakpoint-up($breakpoint-mobile-up) {
338+
.main,
339+
.app-footer {
340+
margin-left: $sidebar-minimized-width;
341+
}
326342
}
327343
}
328344
}
@@ -432,7 +448,7 @@ html[dir="rtl"] {
432448
//
433449
// Mobile layout
434450
//
435-
@include media-breakpoint-down(md) {
451+
@include media-breakpoint-down($breakpoint-mobile-down) {
436452
.app-header {
437453
position: fixed;
438454
z-index: $zindex-sticky;

scss/_navbar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
background-color: rgba(0, 0, 0, .075);
115115
}
116116

117-
@include media-breakpoint-up(lg) {
117+
@include media-breakpoint-up($breakpoint-mobile-up) {
118118
.brand-minimized {
119119
.app-header {
120120
.navbar-brand {

scss/_sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
}
322322
}
323323

324-
@include media-breakpoint-up(lg) {
324+
@include media-breakpoint-up($breakpoint-mobile-up) {
325325
.sidebar-compact {
326326
.sidebar {
327327
.sidebar-nav {

scss/_variables.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,7 @@ $switch-handle-margin: 2px !default;
202202

203203
// Cursor
204204
$cursor-disabled: default !default;
205+
206+
// Breakpoints for mobile
207+
$breakpoint-mobile-up: lg !default;
208+
$breakpoint-mobile-down: md !default;

0 commit comments

Comments
 (0)