Skip to content

Commit 5cd71dc

Browse files
committed
Add carousel component
1 parent 09d235b commit 5cd71dc

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

.changeset/shaky-phones-learn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'hexo-theme-cupertino': minor
3+
---
4+
5+
Add carousel component.

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ builtin_components:
163163
button: true
164164
badge: true
165165
utilities: true
166+
carousel: true
166167

167168
# smooth scroll powered by [darkroomengineering/lenis](https://github.com/darkroomengineering/lenis)
168169
smooth_scroll: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.carousel {
2+
max-width: 100%;
3+
overflow-x: scroll;
4+
display: flex;
5+
gap: 12px;
6+
$paddingX: max(calc((100% - 800px) / 2), 16px);
7+
padding-left: $paddingX;
8+
padding-right: $paddingX;
9+
10+
.carousel-item {
11+
width: auto;
12+
height: 320px;
13+
max-height: 80svh;
14+
margin: 0;
15+
padding: 0;
16+
border-radius: var(--radius-medium);
17+
}
18+
19+
& > figure {
20+
margin: 0;
21+
padding: 0 !important;
22+
}
23+
}

0 commit comments

Comments
 (0)