Skip to content

Commit 3f2a5a7

Browse files
committed
Add card component styles and improve learn section layout
1 parent 7815921 commit 3f2a5a7

1 file changed

Lines changed: 106 additions & 65 deletions

File tree

sass/_learn.scss

Lines changed: 106 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,148 @@
11
.learn-sections {
2-
margin: 40px 0;
2+
margin: 40px 0;
33
}
44

55
.learn-list {
6-
list-style-type: none;
7-
padding: 0;
8-
border: 1px solid $heroDark;
9-
border-radius: 8px;
6+
list-style-type: none;
7+
padding: 0;
8+
border: 1px solid $heroDark;
9+
border-radius: 8px;
1010
}
1111

1212
.learn-list li {
13-
margin-bottom: 0;
14-
border-bottom: 1px solid $heroDark;
13+
margin-bottom: 0;
14+
border-bottom: 1px solid $heroDark;
1515

16-
&:hover {
17-
background-color: $brightScndLight;
16+
&:hover {
17+
background-color: $brightScndLight;
1818

19-
.chevron {
20-
transform: translateX(4px) rotate(270deg);
19+
.chevron {
20+
transform: translateX(4px) rotate(270deg);
21+
}
2122
}
22-
}
2323

24-
&:last-child {
25-
border-bottom: none;
26-
}
24+
&:last-child {
25+
border-bottom: none;
26+
}
2727
}
2828

2929
.learn-link {
30-
display: block;
31-
text-decoration: none;
32-
color: inherit;
33-
padding: 20px;
30+
display: block;
31+
text-decoration: none;
32+
color: inherit;
33+
padding: 20px;
3434
}
3535

3636
.learn-item {
37-
display: flex;
38-
justify-content: space-between;
39-
align-items: center;
40-
gap: 20px;
37+
display: flex;
38+
justify-content: space-between;
39+
align-items: center;
40+
gap: 20px;
4141
}
4242

4343
.learn-item img {
44-
width: 200px;
45-
border-radius: 8px;
46-
object-fit: contain;
47-
flex-shrink: 0;
44+
width: 200px;
45+
border-radius: 8px;
46+
object-fit: contain;
47+
flex-shrink: 0;
4848
}
4949

5050
.learn-content {
51-
display: flex;
52-
flex-direction: column;
53-
justify-content: center;
54-
flex: 1; // Let the content take available space
55-
padding: 20px 0; // Consistent vertical padding
51+
display: flex;
52+
flex-direction: column;
53+
justify-content: center;
54+
flex: 1; // Let the content take available space
55+
padding: 20px 0; // Consistent vertical padding
5656
}
5757

5858
.learn-description {
59-
font-size: 0.9em;
60-
opacity: 0.8;
61-
line-height: 1.4;
62-
margin-bottom: 15px;
59+
font-size: 0.9em;
60+
opacity: 0.8;
61+
line-height: 1.4;
62+
margin-bottom: 15px;
6363
}
6464

6565
.learn-title {
66-
font-weight: bold;
67-
font-size: 1.3em;
68-
margin-bottom: 8px;
66+
font-weight: bold;
67+
font-size: 1.3em;
68+
margin-bottom: 8px;
6969
}
7070

7171
.learn-subtitle {
72-
opacity: 0.7;
73-
margin-left: 8px;
72+
opacity: 0.7;
73+
margin-left: 8px;
7474
}
7575

76-
@media (max-width: 768px) {
77-
.learn-item {
78-
flex-direction: column;
79-
align-items: flex-start;
80-
}
76+
.card-item {
77+
display: flex;
78+
align-items: center;
79+
gap: 16px;
80+
padding: 12px 0;
81+
}
8182

82-
.learn-item img {
83+
.card-logo-wrapper {
84+
width: 48px;
85+
height: 48px;
86+
flex-shrink: 0;
87+
display: flex;
88+
align-items: center;
89+
justify-content: center;
90+
}
91+
92+
.card-img {
8393
width: 100%;
84-
height: auto; // Let height adjust proportionally
85-
max-height: 200px; // Cap the height
86-
margin-bottom: 15px;
87-
}
94+
height: auto;
95+
object-fit: contain;
96+
}
8897

89-
.learn-content {
90-
padding: 0;
91-
}
98+
.card-content {
99+
flex: 1;
100+
display: flex;
101+
flex-direction: column;
102+
gap: 4px;
103+
min-width: 0;
104+
}
92105

93-
.learn-link {
94-
padding: 15px;
95-
}
106+
.card-title {
107+
font-weight: 600;
108+
font-size: 1.05rem;
109+
}
110+
111+
.card-meta {
112+
font-size: 0.85rem;
113+
opacity: 0.6;
114+
font-family: JetBrainsMono;
115+
}
116+
117+
@media (max-width: 768px) {
118+
.learn-item {
119+
flex-direction: column;
120+
align-items: flex-start;
121+
}
122+
123+
.learn-item img {
124+
width: 100%;
125+
height: auto; // Let height adjust proportionally
126+
max-height: 200px; // Cap the height
127+
margin-bottom: 15px;
128+
}
129+
130+
.learn-content {
131+
padding: 0;
132+
}
133+
134+
.learn-link {
135+
padding: 15px;
136+
}
96137
}
97138

98139
@media (prefers-color-scheme: dark) {
99-
.learn-list {
100-
color: white;
101-
border: 1px solid rgba(white, 0.5);
102-
}
103-
104-
.learn-list li {
105-
border-bottom: 1px solid rgba(white, 0.5);
106-
}
140+
.learn-list {
141+
color: white;
142+
border: 1px solid rgba(white, 0.5);
143+
}
144+
145+
.learn-list li {
146+
border-bottom: 1px solid rgba(white, 0.5);
147+
}
107148
}

0 commit comments

Comments
 (0)