Skip to content

Commit 0fd8d71

Browse files
fix: added horizontal scroll to tutorials table for better mobile responsiveness
Signed-off-by: Rajesh-Nagarajan-11 <[email protected]>
1 parent 5b4850a commit 0fd8d71

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

src/sections/Community/Newcomers-guide/Tutorials-table/TutorialsTable.style.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@ import styled from "styled-components";
22

33
export const TutorialsTableWrapper = styled.div`
44
box-shadow:0 2px 16px rgba(0,0,0,0.2);
5+
overflow-x: auto;
6+
-webkit-overflow-scrolling: touch;
7+
8+
@media (max-width: 768px) {
9+
margin: 0 -1rem;
10+
border-radius: 0;
11+
}
512
613
table{
714
display: table;
815
width: 100%;
16+
min-width: 600px;
917
height: auto;
1018
border-collapse: collapse;
1119
margin: 3.75rem auto;
20+
21+
@media (max-width: 768px) {
22+
margin: 1rem auto;
23+
min-width: 700px;
24+
}
1225
th {
1326
color: white;
1427
}
@@ -26,8 +39,23 @@ export const TutorialsTableWrapper = styled.div`
2639
th, td {
2740
border-bottom: 1px solid #F0F0F0;
2841
padding: 0 0.625rem;
42+
white-space: nowrap;
43+
44+
@media (max-width: 768px) {
45+
padding: 0 0.5rem;
46+
font-size: 0.9rem;
47+
}
48+
49+
@media (max-width: 480px) {
50+
padding: 0 0.375rem;
51+
font-size: 0.85rem;
52+
}
53+
2954
p{
3055
margin: 0.5rem 0;
56+
@media (max-width: 768px) {
57+
margin: 0.25rem 0;
58+
}
3159
}
3260
span {
3361
display: block;
@@ -42,6 +70,33 @@ export const TutorialsTableWrapper = styled.div`
4270
img {
4371
height: 26px;
4472
width: auto;
73+
74+
@media (max-width: 768px) {
75+
height: 22px;
76+
}
77+
78+
@media (max-width: 480px) {
79+
height: 20px;
80+
}
4581
}
4682
}
83+
84+
/* Scrollbar styling for better UX */
85+
&::-webkit-scrollbar {
86+
height: 8px;
87+
}
88+
89+
&::-webkit-scrollbar-track {
90+
background: #f1f1f1;
91+
border-radius: 4px;
92+
}
93+
94+
&::-webkit-scrollbar-thumb {
95+
background: ${props => props.theme.secondaryColor};
96+
border-radius: 4px;
97+
}
98+
99+
&::-webkit-scrollbar-thumb:hover {
100+
background: ${props => props.theme.primaryColor};
101+
}
47102
`;

0 commit comments

Comments
 (0)