Skip to content

Commit fc9cd74

Browse files
committed
Added a screen offset utility class
1 parent 0a36dc8 commit fc9cd74

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

scss/utilities/static/_helpers.scss

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,38 @@
2020
//
2121

2222
.scrollable-x {
23-
white-space: nowrap;
24-
overflow-x: auto;
25-
overflow-y: hidden;
26-
-ms-overflow-style: -ms-autohiding-scrollbar;
23+
white-space: nowrap;
24+
overflow-x: auto;
25+
overflow-y: hidden;
26+
-ms-overflow-style: -ms-autohiding-scrollbar;
2727

28-
&::-webkit-scrollbar {
29-
display: none;
30-
}
28+
&::-webkit-scrollbar {
29+
display: none;
30+
}
3131
}
3232

3333
.scrollable-y {
34-
white-space: nowrap;
35-
overflow-x: hidden;
36-
overflow-y: auto;
37-
-ms-overflow-style: -ms-autohiding-scrollbar;
34+
white-space: nowrap;
35+
overflow-x: hidden;
36+
overflow-y: auto;
37+
-ms-overflow-style: -ms-autohiding-scrollbar;
3838

39-
&::-webkit-scrollbar {
40-
display: none;
41-
}
39+
&::-webkit-scrollbar {
40+
display: none;
41+
}
4242
}
4343

4444

45+
// Screen offset based on screen sizes
46+
@each $size, $value in $screen-widths {
47+
.offset-left-#{$size} {
48+
padding-left: max($grid-gutter-width * 0.5, calc((100% - $value) / 2 + $grid-gutter-width * 0.5));
49+
}
50+
.offset-right-#{$size} {
51+
padding-right: max($grid-gutter-width * 0.5, calc((100% - $value) / 2 + $grid-gutter-width * 0.5));
52+
}
53+
}
54+
4555
// Fading elements
4656

4757
[class*="faded"],

0 commit comments

Comments
 (0)