1
1
mirror of https://github.com/primer/css.git synced 2024-11-29 14:14:26 +03:00

add sidebar positioning classes when flowing as row

This commit is contained in:
Manuel Puyol 2021-05-25 16:00:00 -05:00
parent b321af0ba8
commit af1e573a48
2 changed files with 47 additions and 0 deletions

View File

@ -188,6 +188,27 @@ Add `Layout-divider--shallow` to change the divider on `sm` to be filled and 8px
</div>
```
### Sidebar positioning as rows
- `Layout--sidebarPosition-flowRow-start` (default): when stacked, render the sidebar first
- `Layout--sidebarPosition-flowRow-end`: when stacked, render the sidebar last
- `Layout--sidebarPosition-flowRow-none`: when stacked, hide the sidebar
```html live
<div class="Layout Layout--sidebarPosition-flowRow-start">
<div class="Layout-main border">main</div>
<div class="Layout-sidebar border">sidebar</div>
</div>
<div class="Layout Layout--sidebarPosition-flowRow-end">
<div class="Layout-main border">main</div>
<div class="Layout-sidebar border">sidebar</div>
</div>
<div class="Layout Layout--sidebarPosition-flowRow-none">
<div class="Layout-main border">main</div>
<div class="Layout-sidebar border">sidebar</div>
</div>
```
### Layout stacking
- Default: stacks when container is `sm`.

View File

@ -14,6 +14,32 @@
&.Layout--divided {
@include flow-as-row-divider;
}
&.Layout--sidebarPosition-flowRow-start {
.Layout-sidebar {
grid-row: 1;
}
.Layout-main {
grid-row: 2 / span 2;
}
}
&.Layout--sidebarPosition-flowRow-end {
.Layout-sidebar {
grid-row: 2 / span 2;
}
.Layout-main {
grid-row: 1;
}
}
&.Layout--sidebarPosition-flowRow-none {
.Layout-sidebar {
display: none;
}
}
}
@mixin flow-as-row-divider {