Skip to content

Commit 148478b

Browse files
handymathis@gmail..comhandymathis@gmail..com
authored andcommitted
added flex utils
1 parent ea8ac5d commit 148478b

File tree

5 files changed

+49
-17
lines changed

5 files changed

+49
-17
lines changed

flex/constants.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$sm: 400px;
2+
$md: 680px;
3+
$lg: 100vw;

flex/container.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
@mixin containerShape($class-name, $size) {
3+
4+
.#{$class-name} {
5+
width: $size;
6+
display: flex;
7+
flex-direction: column;
8+
flex-wrap: wrap;
9+
justify-content: center;
10+
}
11+
}

flex/row.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
@mixin rowShape($class-name, $size) {
3+
4+
.#{$class-name} {
5+
width: $size;
6+
display: flex;
7+
flex-direction: row;
8+
flex-wrap: wrap;
9+
justify-content: center;
10+
}
11+
}

index.html

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,13 @@
88

99
<body style="background: #161616;">
1010

11-
<nav class="sidebar sidebar-light">
12-
<button class="sidebar-item sidebar-toggler">
13-
<div class="hidden-content">Hide</div>
14-
</button>
15-
<button class="sidebar-item">
16-
<div class="hidden-content">text 1</div>
17-
</button>
18-
<button class="sidebar-item">
19-
<div class="hidden-content">text 2</div>
20-
</button>
21-
<button class="sidebar-item">
22-
<div class="hidden-content">text 3</div>
23-
</button>
24-
</nav>
25-
26-
<script src="js/sidebar-toggler.js"></script>
11+
<div class="container-lg">
12+
<div class="row-lg">
13+
<div style="width: 700px; background: blue; height: 3em;"></div>
14+
<div style="width: 500px; background: red; height: 3em;"></div>
15+
<div style="width: 300px; background: green; height: 3em;"></div>
16+
</div>
17+
</div>
2718

2819
</body>
2920
</html>

main.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
@import "./nav/sidebar/sidebar.scss";
1717
@import "./nav/sidebar/theme.scss";
1818

19+
// Flex
20+
@import "./flex/container.scss";
21+
@import "./flex/row.scss";
22+
@import "./flex/constants.scss";
23+
1924

2025

2126
// Buttons
@@ -35,4 +40,15 @@
3540
// Sidebar
3641
@include sidebarTheme(sidebar-grey, #4D4D4D, rgba(0,0,0,0.3), #fff);
3742
@include sidebarTheme(sidebar-dark, #1d1d1d, rgba(0,0,0,0.4), #fff);
38-
@include sidebarTheme(sidebar-light, #838383, rgba(0,0,0,0.2), #0f0f0f);
43+
@include sidebarTheme(sidebar-light, #838383, rgba(0,0,0,0.2), #0f0f0f);
44+
45+
// Flex container
46+
@include containerShape(container-sm, $sm);
47+
@include containerShape(container-md, $md);
48+
@include containerShape(container-lg, $lg);
49+
50+
51+
// Flex row
52+
@include rowShape(row-sm, $sm);
53+
@include rowShape(row-md, $md);
54+
@include rowShape(row-lg, $lg);

0 commit comments

Comments
 (0)