Skip to content

Commit afd240e

Browse files
committed
Updating styles for mobile sidebar navigation
1 parent 76cca17 commit afd240e

File tree

2 files changed

+48
-24
lines changed

2 files changed

+48
-24
lines changed

components/sidebar-mobile/sidebar-mobile-style.scss

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
overflow-x: hidden;
1212
-webkit-overflow-scrolling: touch;
1313
transform: translate3D(-100%, 0, 0);
14-
transform: translate3D(calc(-100% + 5px), 0, 0);
15-
transition: all 500ms;
14+
transition: all 500ms cubic-bezier(0.23, 1, 0.32, 1);
1615

1716
@include break {
1817
display: none;
1918
}
20-
19+
2120
&--visible {
2221
transform: translate3D(0, 0, 0);
2322
}
@@ -40,50 +39,73 @@
4039
width: 285px;
4140
height: 100vh;
4241
overflow-x: hidden;
42+
padding: 12px 0;
4343
background: getColor(white);
44-
box-shadow: 0 0 5px getColor(emperor);
44+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
4545
}
4646

4747
.sidebar-mobile__close {
4848
position:absolute;
49-
right:16px;
50-
top:19px;
51-
font-size:1.5em;
5249
cursor:pointer;
53-
color:getColor(dusty-grey);
54-
transition:color 250ms;
50+
right: 22px;
51+
top: 28px;
52+
font-size: 1.3em;
53+
background: getColor(denim);
54+
color: getColor(white);
55+
width: 30px;
56+
height: 30px;
57+
display: flex;
58+
align-items: center;
59+
justify-content: center;
60+
border-radius: 50%;
61+
transition: background 150ms;
62+
-webkit-tap-highlight-color: transparent;
5563

5664
&:hover {
57-
color:getColor(mine-shaft);
65+
background: darken(getColor(denim), 20%);
5866
}
5967
}
6068

6169
.sidebar-mobile__section {
62-
font-size: getFontSize(1);
63-
text-transform: uppercase;
64-
color: getColor(mine-shaft);
65-
margin: 1em 16px 0.25em;
70+
border-left: 2px solid transparent;
71+
padding-bottom:0.5em;
72+
73+
&--active {
74+
border-left: 2px solid getColor(malibu);
6675

67-
&--block {
68-
display: block;
76+
.sidebar-mobile__section-header {
77+
color: lighten(getColor(fiord), 15%)
78+
}
6979
}
80+
}
7081

71-
&:active,
72-
&--active {
73-
color: getColor(malibu);
82+
.sidebar-mobile__section-header {
83+
text-transform: uppercase;
84+
color: getColor(elephant);
85+
padding: 0.75em 16px 0.25em;
86+
font-weight: 600;
87+
display: block;
88+
89+
.sidebar-mobile__content div:not(:first-of-type) & {
90+
border-top: 1px solid getColor(alto);
7491
}
7592
}
7693

7794
.sidebar-mobile__page {
7895
display: block;
7996
padding: 0.5em 17px;
8097
text-transform: capitalize;
81-
color: getColor(dusty-grey);
98+
color: getColor(dove-grey);
8299
-webkit-tap-highlight-color: rgba(0,0,0,0);
83100

84101
&:active,
85102
&--active {
86103
color: getColor(mine-shaft);
87-
background: getColor(alto);
104+
font-weight: 600;
105+
background: #F1F4F4;
106+
}
107+
108+
&:hover {
109+
color: inherit;
88110
}
89111
}

components/sidebar-mobile/sidebar-mobile.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export default class SidebarMobile extends React.Component {
6868
let active = pathname === section.url || pathname.includes(`/${section.url}`),
6969
absoluteUrl = `/${section.url}`;
7070
return (
71-
<div key={ absoluteUrl }>
72-
<Link
73-
className={ `sidebar-mobile__section sidebar-mobile__section--block ${active ? 'sidebar-mobile__section--active' : ''}` }
71+
<div
72+
className={ `sidebar-mobile__section ${active ? 'sidebar-mobile__section--active' : ''}` }
73+
key={ absoluteUrl }>
74+
<Link
75+
className="sidebar-mobile__section-header"
7476
key={ absoluteUrl }
7577
to={ absoluteUrl }
7678
onClick={ this._close.bind(this) }>

0 commit comments

Comments
 (0)