Skip to content

Commit 258c81a

Browse files
authored
Merge pull request #1576 from oasisprotocol/kaja/doccard-mobile
Homepage DocCard mobile
2 parents 21b9a08 + 1aee9e3 commit 258c81a

File tree

4 files changed

+76
-54
lines changed

4 files changed

+76
-54
lines changed

docs/README.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import BlocksSvg from "@site/static/img/BlocksGraphic.svg?react";
1616
<DocCardSection
1717
title="Use Cases"
1818
path="/build/use-cases"
19-
fullWidth
2019
itemPaths={[
2120
"/build/use-cases/key-generation",
2221
"/build/use-cases/trustless-agent",
@@ -35,7 +34,6 @@ import BlocksSvg from "@site/static/img/BlocksGraphic.svg?react";
3534
<DocCardSection
3635
title="Build on Oasis"
3736
path="/build/"
38-
fullWidth
3937
itemPaths={[
4038
"/build/rofl/",
4139
"/build/sapphire/",

src/components/DocCardSection.module.css

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.customCard {
2-
background: linear-gradient(0deg, rgba(255, 255, 255, 0.00) 53.75%, var(--ifm-color-primary) 180%);
32
border: 1px solid #e2e8f0;
43
border-radius: 0.5rem;
54
padding: 1.5rem;
@@ -15,19 +14,21 @@
1514
.customCard::before {
1615
content: '';
1716
position: absolute;
17+
top: 0;
18+
left: 0;
19+
width: 100%;
20+
height: 25rem;
1821
inset: 0;
19-
background: linear-gradient(0deg, rgba(255, 255, 255, 0.00) 53.75%, #5FA8D3 180%);
20-
opacity: 0;
22+
background: linear-gradient(0deg, rgba(255, 255, 255, 0) 10.75%, var(--ifm-color-primary) 220%);
23+
opacity: 1;
2124
transition: opacity 0.5s ease;
2225
z-index: -1;
2326
}
2427

25-
2628
.customCard:hover::before {
27-
opacity: 1;
29+
opacity: 0.8;
2830
}
2931

30-
3132
.fullWidth {
3233
flex: 1 1 100%;
3334
max-width: 100%;
@@ -39,12 +40,12 @@
3940
color: var(--ifm-color-card-heading);
4041
}
4142

42-
.customCard h2 a{
43+
.customCard h2 a {
4344
color: var(--ifm-color-card-heading);
4445
transition: all .2s ease;
4546
}
4647

47-
.customCard > p {
48+
.customCard>p {
4849
font-size: 0.9rem;
4950
color: #64748b;
5051
margin-bottom: 1.5rem;
@@ -57,17 +58,17 @@
5758
position: relative;
5859
}
5960

60-
.cardDescription{
61+
.cardDescription {
6162
color: var(--ifm-color-secondary-text);
6263
}
6364

64-
.cardDescription a{
65-
color: var(--ifm-color-secondary-text)!important;
65+
.cardDescription a {
66+
color: var(--ifm-color-secondary-text) !important;
6667
text-decoration: underline;
6768
}
6869

69-
[data-theme='dark'] .cardItem a{
70-
border: none!important;
70+
[data-theme='dark'] .cardItem a {
71+
border: none !important;
7172
}
7273

7374
.cardItem h3 {
@@ -93,9 +94,9 @@
9394
}
9495

9596
.cardItem a h3 {
96-
font-size: 1rem!important;
97+
font-size: 1rem !important;
9798
margin: 0;
98-
font-weight: 600!important;
99+
font-weight: 600 !important;
99100
color: var(--ifm-color-card-heading-secondary);
100101
transition: all .2s ease;
101102
}
@@ -105,28 +106,28 @@
105106
}
106107

107108
.cardItem a p {
108-
font-size: 0.875rem!important;
109-
margin: 0!important;
109+
font-size: 0.875rem !important;
110+
margin: 0 !important;
110111
color: var(--ifm-color-secondary-text);
111112
max-width: 90%;
112113
}
113114

114-
.cardItem a h2 span{
115-
display: none!important;
115+
.cardItem a h2 span {
116+
display: none !important;
116117
}
117118

118119
.cardLinksList .cardItem:last-child {
119120
border-bottom: none;
120121
}
121122

122-
.cardContentFlex{
123+
.cardContentFlex {
123124
display: flex;
124125
justify-content: space-between;
125126
align-items: start;
126127
gap: 1.5rem;
127128
}
128129

129-
.halfWidth{
130+
.halfWidth {
130131
width: 50%;
131132
max-width: calc(50% - 0.75rem);
132133
}
@@ -156,7 +157,7 @@ html[data-theme='dark'] .cardItem::after {
156157
right: 0.5rem;
157158
}
158159

159-
.animatedSvgWrapper{
160+
.animatedSvgWrapper {
160161
position: absolute;
161162
width: 100%;
162163
max-width: 400px;
@@ -212,15 +213,28 @@ html[data-theme='dark'] .cardItem::after {
212213
@media (max-width: 768px) {
213214
.customCard {
214215
max-width: 100%;
216+
padding-top: 10rem;
215217
}
216218

217-
.halfWidth{
219+
.customCard::before {
220+
height: 13rem;
221+
}
222+
223+
.animatedSvgWrapper {
224+
max-width: 180px;
225+
}
226+
227+
.animatedSvgWrapper svg {
228+
height: auto;
229+
}
230+
231+
.halfWidth {
218232
width: 100%;
219233
max-width: 100%;
220234
}
221235

222-
.cardContentFlex{
236+
.cardContentFlex {
223237
flex-direction: column;
224238
gap: 1.5rem;
225239
}
226-
}
240+
}

static/img/CoreGraphic.svg

Lines changed: 16 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)