mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-07 23:43:57 +02:00
ui: further style collapsible sidebar
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import styled from "styled-components"
|
||||
import { Link } from "gatsby"
|
||||
import ChevronUp from "../../icons/chevron-up.svg"
|
||||
|
||||
export const ResourcesSidebarWrapper = styled.div`
|
||||
box-sizing: border-box;
|
||||
@@ -14,20 +15,96 @@ export const Banner = styled.img`
|
||||
|
||||
export const TreeWrapper = styled.div`
|
||||
width: 100%;
|
||||
padding: 12px 0;
|
||||
|
||||
& + & {
|
||||
border-top: 1px solid #dbdbdb;
|
||||
}
|
||||
`
|
||||
|
||||
export const Label = styled.div`
|
||||
padding: 4px 0;
|
||||
`
|
||||
|
||||
export const FirstLabel = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 12px 15px 12px 0;
|
||||
font-weight: 700;
|
||||
color: #a9a9a9;
|
||||
|
||||
&.active {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
svg {
|
||||
margin-left: auto;
|
||||
transform: rotate(90deg);
|
||||
transition: transform 0.3s;
|
||||
|
||||
path {
|
||||
fill: #a9a9a9;
|
||||
}
|
||||
}
|
||||
|
||||
&.active svg {
|
||||
transform: rotate(0);
|
||||
|
||||
path {
|
||||
fill: #000;
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const CollapseToggler = styled(ChevronUp)``
|
||||
|
||||
export const Inner = styled.div`
|
||||
padding-top: 30px;
|
||||
padding-left: 20px;
|
||||
|
||||
/* TODO: change this.. */
|
||||
& > ${TreeWrapper} > .tree-view > .tree-view_item > div {
|
||||
font-weight: 700;
|
||||
.tree-view {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.tree-view_item {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tree-view_children {
|
||||
margin-left: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tree-view_children-collapsed {
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.tree-view_arrow {
|
||||
cursor: pointer;
|
||||
margin-right: 6px;
|
||||
display: inline-block;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.tree-view_arrow:after {
|
||||
content: "▾";
|
||||
}
|
||||
|
||||
.tree-view_arrow.firstLevel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tree-view_arrow-collapsed {
|
||||
-webkit-transform: rotate(-90deg);
|
||||
-moz-transform: rotate(-90deg);
|
||||
-ms-transform: rotate(-90deg);
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user