Skip to content

Commit 1c166e8

Browse files
authored
Merge pull request #478 from ember-learn/sidebar-cleanup
Sidebar clean up + full width
2 parents f385ddb + 63702c6 commit 1c166e8

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

addon/styles/components/es-sidebar.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99
display: none;
1010
}
1111

12+
.es-sidebar--border-right {
13+
border-right: 2px solid var(--color-gray-300);
14+
}
15+
1216
@media (max-width: 844px) {
1317
.es-sidebar-toggle {
1418
position: fixed;
19+
z-index: 1;
1520
bottom: 30px;
1621
right: 30px;
1722

@@ -43,6 +48,7 @@
4348
box-sizing: border-box;
4449
display: none;
4550
position: fixed;
51+
z-index: 1;
4652
top: var(--es-sidebar-padding);
4753
left: var(--es-sidebar-padding);
4854
height: calc(100% - var(--es-sidebar-padding) * 2);
@@ -81,4 +87,8 @@
8187
.es-sidebar-close svg path {
8288
fill: currentColor;
8389
}
90+
91+
.es-sidebar--border-right {
92+
border-right: none;
93+
}
8494
}

addon/styles/sidebar-container.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
grid-column: 2 / span 2;
2020
}
2121

22+
.sidebar-container--full-width {
23+
max-width: 100%;
24+
padding: 0;
25+
}
26+
2227
@media (max-width: 844px) {
2328
.sidebar-container {
2429
display: block;

docs/components/sidebar.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,42 @@ The sidebar component will automatically switch to the mobile mode once your bro
5050
</EsSidebar>
5151
</div>
5252
```
53+
54+
55+
### Full Width Left Sidebar Example
56+
```handlebars
57+
<div class="sidebar-container sidebar-container--full-width">
58+
<EsSidebar>
59+
My Left Sidebar Content
60+
</EsSidebar>
61+
<div class="example-content">
62+
My Content
63+
</div>
64+
</div>
65+
```
66+
67+
### Full Width Right Sidebar Example
68+
```handlebars
69+
<div class="sidebar-container sidebar-container--full-width">
70+
<div class="example-content">
71+
My Content
72+
</div>
73+
<EsSidebar>
74+
My Right Sidebar Content
75+
</EsSidebar>
76+
</div>
77+
```
78+
79+
### Sidebar Right Border
80+
There is a class, `es-sidebar--border-right`, that you can add to your sidebar to give it a right border. This will not show up in mobile.
81+
```handlebars
82+
<div class="sidebar-container">
83+
<EsSidebar class="es-sidebar--border-right">
84+
My Left Sidebar Content
85+
</EsSidebar>
86+
<div class="example-content">
87+
My Content
88+
</div>
89+
</div>
90+
```
91+

0 commit comments

Comments
 (0)