Skip to content

Sidebar clean up + full width #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions addon/styles/components/es-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
display: none;
}

.es-sidebar--border-right {
border-right: 2px solid var(--color-gray-300);
}

@media (max-width: 844px) {
.es-sidebar-toggle {
position: fixed;
z-index: 1;
bottom: 30px;
right: 30px;

Expand Down Expand Up @@ -43,6 +48,7 @@
box-sizing: border-box;
display: none;
position: fixed;
z-index: 1;
top: var(--es-sidebar-padding);
left: var(--es-sidebar-padding);
height: calc(100% - var(--es-sidebar-padding) * 2);
Expand Down Expand Up @@ -81,4 +87,8 @@
.es-sidebar-close svg path {
fill: currentColor;
}

.es-sidebar--border-right {
border-right: none;
}
}
5 changes: 5 additions & 0 deletions addon/styles/sidebar-container.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
grid-column: 2 / span 2;
}

.sidebar-container--full-width {
max-width: 100%;
padding: 0;
}

@media (max-width: 844px) {
.sidebar-container {
display: block;
Expand Down
39 changes: 39 additions & 0 deletions docs/components/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,42 @@ The sidebar component will automatically switch to the mobile mode once your bro
</EsSidebar>
</div>
```


### Full Width Left Sidebar Example
```handlebars
<div class="sidebar-container sidebar-container--full-width">
<EsSidebar>
My Left Sidebar Content
</EsSidebar>
<div class="example-content">
My Content
</div>
</div>
```

### Full Width Right Sidebar Example
```handlebars
<div class="sidebar-container sidebar-container--full-width">
<div class="example-content">
My Content
</div>
<EsSidebar>
My Right Sidebar Content
</EsSidebar>
</div>
```

### Sidebar Right Border
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.
```handlebars
<div class="sidebar-container">
<EsSidebar class="es-sidebar--border-right">
My Left Sidebar Content
</EsSidebar>
<div class="example-content">
My Content
</div>
</div>
```