Skip to content

Commit 2229fa0

Browse files
committed
Fix YouTube Clone UI: sidebar alignment, spacing, and overflow issues
1 parent bc0f7d4 commit 2229fa0

File tree

1 file changed

+75
-61
lines changed

1 file changed

+75
-61
lines changed

YoutubeClone/styles/style.css

Lines changed: 75 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ p {
44
}
55

66
body {
7-
87
font-family: Roboto, Arial;
98
margin: 0;
109
padding-top: 80px;
@@ -13,8 +12,8 @@ body {
1312
background-color: rgb(240, 240, 240);
1413
}
1514

16-
@media (min-width: 1200px){
17-
body{
15+
@media (min-width: 1200px) {
16+
body {
1817
padding-left: 171px;
1918
}
2019
}
@@ -83,17 +82,22 @@ body {
8382
margin-right: 10px;
8483
}
8584

86-
.search-button, .voice-search-button, .upload-icon-container,
87-
.youtube-app-icon-container, .notifications-icon-container{
85+
.search-button,
86+
.voice-search-button,
87+
.upload-icon-container,
88+
.youtube-app-icon-container,
89+
.notifications-icon-container {
8890
position: relative;
8991
display: flex;
9092
justify-content: center;
9193
align-items: center;
9294
}
9395

94-
.search-button .tooltip, .voice-search-button .tooltip,
95-
.upload-icon-container .tooltip, .youtube-app-icon-container .tooltip,
96-
.notifications-icon-container .tooltip{
96+
.search-button .tooltip,
97+
.voice-search-button .tooltip,
98+
.upload-icon-container .tooltip,
99+
.youtube-app-icon-container .tooltip,
100+
.notifications-icon-container .tooltip {
97101
position: absolute;
98102
background-color: gray;
99103
color: white;
@@ -107,9 +111,11 @@ body {
107111
white-space: nowrap;
108112
}
109113

110-
.search-button:hover .tooltip, .voice-search-button:hover .tooltip,
111-
.upload-icon-container:hover .tooltip, .youtube-app-icon-container:hover
112-
.tooltip, .notifications-icon-container:hover .tooltip{
114+
.search-button:hover .tooltip,
115+
.voice-search-button:hover .tooltip,
116+
.upload-icon-container:hover .tooltip,
117+
.youtube-app-icon-container:hover .tooltip,
118+
.notifications-icon-container:hover .tooltip {
113119
opacity: 1;
114120
}
115121

@@ -138,19 +144,19 @@ body {
138144
flex-shrink: 0;
139145
}
140146

141-
.upload-icon{
147+
.upload-icon {
142148
height: 24px;
143149
}
144150

145-
.youtube-app-icon{
151+
.youtube-app-icon {
146152
height: 24px;
147153
}
148154

149-
.notifications-icon{
155+
.notifications-icon {
150156
height: 24px;
151157
}
152158

153-
.notifications-count{
159+
.notifications-count {
154160
position: absolute;
155161
top: -2px;
156162
right: -5px;
@@ -161,72 +167,79 @@ body {
161167
border-radius: 10px;
162168
}
163169

164-
.current-user-picture{
170+
.current-user-picture {
165171
height: 28px;
166172
border-radius: 16px;
167173
width: 26px;
168174
}
169-
.sidebar{
170-
position: fixed;
171-
left: 0;
172-
bottom: 0;
173-
top: 55px;
174-
width: 75px;
175-
background-color: white;
176-
z-index: 200;
177-
padding-top: 5px;
175+
.sidebar {
176+
position: fixed;
177+
left: 0;
178+
bottom: 0;
179+
top: 56px;
180+
width: 72px;
181+
background-color: white;
182+
z-index: 200;
183+
padding-top: 5px;
184+
display: flex;
185+
flex-direction: column;
186+
align-items: center;
187+
gap: 20px;
178188
}
179189

180-
181190
@media (min-width: 1200px) {
182-
.sidebar{
183-
width: 150px;
184-
}
191+
.sidebar {
192+
width: 150px;
193+
align-items: flex-start;
194+
padding-left: 20px;
185195
}
196+
}
186197

187-
.sidebar-link{
188-
padding-top: 10px;
189-
padding-bottom: 10px;
190-
display: flex;
191-
justify-content: center;
192-
align-items: center;
193-
flex-direction: column;
194-
cursor: pointer;
198+
.sidebar-link {
199+
padding-top: 10px;
200+
/* padding-bottom: 10px; */
201+
display: flex;
202+
justify-content: center;
203+
align-items: center;
204+
flex-direction: column;
205+
cursor: pointer;
206+
width: 100%;
207+
transition: background-color 0.2s;
195208
}
196209

197-
@media (min-width: 1201px){
198-
.sidebar-link {
199-
height: auto;
200-
padding: 10px 0;
201-
flex-direction: row;
202-
justify-content: flex-start;
203-
align-items: center;
204-
margin-left: 0;
205-
margin-right: 0;
206-
padding-left: 20px;
207-
gap: 20px;
208-
}
210+
@media (min-width: 1201px) {
211+
.sidebar-link {
212+
flex-direction: row;
213+
justify-content: flex-start;
214+
gap: 20px;
215+
padding-bottom: 10px;
216+
}
217+
.sidebar-link div {
218+
font-size: 18px;
219+
}
209220
}
210-
.sidebar-link:hover{
211-
background-color: rgb(235, 235, 235);
221+
.sidebar-link:hover {
222+
background-color: #f0f0f0;
212223
}
213224

214-
.sidebar-link img{
215-
height: 24px;
216-
margin-bottom: 0px;
217-
margin-top: 2rem;
225+
.sidebar-link img {
226+
height: 24px;
227+
margin-bottom: 6px;
228+
/* margin-top: 2rem; */
218229
}
219230

220-
.sidebar-link div{
221-
font-size: 12px;
222-
margin-top: 2rem;
231+
.sidebar-link div {
232+
font-size: 12px;
233+
/* margin-top: 2rem; */
234+
text-align: center;
235+
color: #0f0f0f;
223236
}
224237

225238
.thumbnail {
226239
width: 100%;
227240
}
228241

229-
.video-link{
242+
.video-link {
230243
color: black;
231244
}
232245
.video-title {
@@ -242,7 +255,8 @@ body {
242255
font-size: 16px;
243256
line-height: 24px;
244257
}
245-
.video-author, .video-stats{
258+
.video-author,
259+
.video-stats {
246260
font-size: 14px;
247261
}
248262
}
@@ -307,4 +321,4 @@ body {
307321
position: absolute;
308322
bottom: 8px;
309323
right: 5px;
310-
}
324+
}

0 commit comments

Comments
 (0)