Skip to content

Commit 5160a9a

Browse files
committed
fix: #19 make sidebar width fixed
1 parent 3a3c5b0 commit 5160a9a

File tree

4 files changed

+113
-109
lines changed

4 files changed

+113
-109
lines changed

src/scss/consts/consts.scss

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ $site-border: 1px solid var(--primary-100);
33
$bp-mobile-view: 900px;
44

55
$bp-small-width-view: 500px;
6+
7+
$sidebar-width: 345px;

src/scss/raw-components/nav.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '../consts/consts.scss';
22

33
.page-top {
4-
width: 70%;
4+
width: calc(100% - $sidebar-width);
55
position: fixed;
66
right: 0;
77
z-index: 3;

src/scss/raw-components/sidebar.scss

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
@import '../consts/consts.scss';
2+
3+
.sidebar {
4+
width: $sidebar-width;
5+
-webkit-background-size: cover;
6+
background-size: cover;
7+
background-color: var(--secondary);
8+
height: 100%;
9+
transition: all 0.8s;
10+
top: 0;
11+
left: 0;
12+
position: fixed;
13+
z-index: 4;
14+
border-right: $site-border;
15+
16+
.logo-title {
17+
text-align: center;
18+
margin-top: -50px;
19+
20+
.description {
21+
font-size: 14px;
22+
color: var(--secondary-350);
23+
}
24+
25+
.logo {
26+
margin: 0 auto;
27+
}
28+
29+
.title {
30+
h3 {
31+
text-transform: none;
32+
font-size: 2rem;
33+
font-weight: bold;
34+
letter-spacing: 2px;
35+
line-height: 1;
36+
margin: 0;
37+
}
38+
39+
a {
40+
text-decoration: none;
41+
color: var(--secondary-350);
42+
font-size: 2rem;
43+
font-weight: bold;
44+
}
45+
}
46+
}
47+
48+
.social-links {
49+
list-style: none;
50+
padding: 0;
51+
font-size: 14px;
52+
text-align: center;
53+
54+
i {
55+
margin-right: 3px;
56+
}
57+
58+
li {
59+
display: inline;
60+
padding: 0 4px;
61+
line-height: 0;
62+
}
63+
64+
a {
65+
color: var(--secondary-350);
66+
}
67+
68+
a:hover {
69+
color: #4786d6;
70+
}
71+
}
72+
73+
@media screen and (max-width: $bp-mobile-view) {
74+
width: 100%;
75+
height: auto;
76+
position: relative;
77+
border-right: none;
78+
z-index: 1;
79+
top: auto;
80+
81+
.logo-title {
82+
padding-top: 120px;
83+
margin-top: 0;
84+
85+
.title {
86+
img {
87+
width: 100px;
88+
}
89+
90+
h3 {
91+
font-size: 20px;
92+
}
93+
}
94+
}
95+
}
96+
}
97+
98+
.sidebar-top {
99+
margin: auto 0;
100+
display: flex;
101+
flex-direction: column;
102+
justify-content: center;
103+
height: 100%;
104+
105+
.ltr {
106+
text-align: center;
107+
}
108+
}

src/scss/style.scss

+2-108
Original file line numberDiff line numberDiff line change
@@ -172,94 +172,12 @@
172172
.content {
173173
height: auto;
174174
float: right;
175-
width: 70%;
175+
width: calc(100% - $sidebar-width);
176176
margin-top: 60px;
177177
}
178178

179179
@import 'raw-components/nav.scss';
180-
181-
.sidebar {
182-
width: 30%;
183-
-webkit-background-size: cover;
184-
background-size: cover;
185-
background-color: var(--secondary);
186-
height: 100%;
187-
transition: all 0.8s;
188-
top: 0;
189-
left: 0;
190-
position: fixed;
191-
z-index: 4;
192-
border-right: $site-border;
193-
194-
.logo-title {
195-
text-align: center;
196-
margin-top: -50px;
197-
198-
.description {
199-
font-size: 14px;
200-
color: var(--secondary-350);
201-
}
202-
203-
.logo {
204-
margin: 0 auto;
205-
}
206-
207-
.title {
208-
h3 {
209-
text-transform: none;
210-
font-size: 2rem;
211-
font-weight: bold;
212-
letter-spacing: 2px;
213-
line-height: 1;
214-
margin: 0;
215-
}
216-
217-
a {
218-
text-decoration: none;
219-
color: var(--secondary-350);
220-
font-size: 2rem;
221-
font-weight: bold;
222-
}
223-
}
224-
}
225-
226-
.social-links {
227-
list-style: none;
228-
padding: 0;
229-
font-size: 14px;
230-
text-align: center;
231-
232-
i {
233-
margin-right: 3px;
234-
}
235-
236-
li {
237-
display: inline;
238-
padding: 0 4px;
239-
line-height: 0;
240-
}
241-
242-
a {
243-
color: var(--secondary-350);
244-
}
245-
246-
a:hover {
247-
color: #4786d6;
248-
}
249-
}
250-
}
251-
252-
.sidebar-top {
253-
margin: auto 0;
254-
display: flex;
255-
flex-direction: column;
256-
justify-content: center;
257-
height: 100%;
258-
259-
.ltr {
260-
text-align: center;
261-
}
262-
}
180+
@import 'raw-components/sidebar.scss';
263181

264182
.card {
265183
margin-left: 5px;
@@ -855,30 +773,6 @@ a.btn {
855773
}
856774

857775
@media screen and (max-width: $bp-mobile-view) {
858-
.sidebar {
859-
width: 100%;
860-
height: auto;
861-
position: relative;
862-
border-right: none;
863-
z-index: 1;
864-
top: auto;
865-
866-
.logo-title {
867-
padding-top: 120px;
868-
margin-top: 0;
869-
870-
.title {
871-
img {
872-
width: 100px;
873-
}
874-
875-
h3 {
876-
font-size: 20px;
877-
}
878-
}
879-
}
880-
}
881-
882776
.post-title h3 {
883777
line-height: 1.6;
884778
}

0 commit comments

Comments
 (0)