Skip to content

Commit fd17aed

Browse files
committed
feat(sheet): m3 styles
1 parent ff86338 commit fd17aed

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
:root {
22
--f7-sheet-height: 260px;
3-
--f7-sheet-border-color: transparent;
4-
--f7-sheet-transition-duration: 300ms;
5-
--f7-sheet-push-border-radius: 10px;
63
--f7-sheet-push-offset: var(--f7-safe-area-top);
4+
}
5+
.ios-vars({
6+
--f7-sheet-border-radius: 0px;
7+
--f7-sheet-border-color: var(--f7-bars-border-color);
8+
--f7-sheet-transition-timing-function: initial;
9+
--f7-sheet-push-border-radius: 10px;
10+
--f7-sheet-transition-duration: 300ms;
711
.light-vars({
812
--f7-sheet-bg-color: #fff;
913
});
1014
.dark-vars({
1115
--f7-sheet-bg-color: #202020;
1216
});
13-
}
14-
.ios-vars({
15-
--f7-sheet-border-color: var(--f7-bars-border-color);
17+
});
18+
.md-vars({
19+
--f7-sheet-border-radius: 16px;
20+
--f7-sheet-push-border-radius: 16px;
21+
--f7-sheet-border-color: transparent;
22+
--f7-sheet-transition-timing-function: cubic-bezier(0, 0.8, 0.34, 1);
23+
--f7-sheet-bg-color: var(--f7-md-surface);
24+
--f7-sheet-transition-duration: 400ms;
1625
});

src/core/components/sheet/sheet.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
}
88
}
99
.sheet-modal {
10+
overflow: hidden;
1011
position: absolute;
1112
left: 0;
1213
bottom: 0;
@@ -59,7 +60,12 @@
5960
}
6061
}
6162
}
63+
.sheet-backdrop,
64+
.sheet-modal {
65+
transition-timing-function: var(--f7-sheet-transition-timing-function);
66+
}
6267
.sheet-modal-top {
68+
border-radius: 0 0 var(--f7-sheet-border-radius) var(--f7-sheet-border-radius);
6369
.hairline(bottom, var(--f7-sheet-border-color));
6470
&:after {
6571
z-index: 700;
@@ -70,6 +76,7 @@
7076
.sheet-modal-bottom,
7177
.sheet-modal:not(.sheet-modal-top) {
7278
--f7-safe-area-top: 0px;
79+
border-radius: var(--f7-sheet-border-radius) var(--f7-sheet-border-radius) 0 0;
7380
.hairline(top, var(--f7-sheet-border-color));
7481
&:before {
7582
z-index: 700;
@@ -112,6 +119,7 @@ html.with-modal-sheet-push-closing {
112119
> .views,
113120
> .view {
114121
transition-duration: var(--f7-sheet-transition-duration);
122+
transition-timing-function: var(--f7-sheet-transition-timing-function);
115123
}
116124
}
117125
.if-dark-theme({
@@ -136,6 +144,7 @@ html.with-modal-sheet-push-closing {
136144
border-radius: var(--f7-sheet-push-border-radius) var(--f7-sheet-push-border-radius) 0 0;
137145
opacity: 1;
138146
animation: sheet-dark-push-overlay-fade-in var(--f7-sheet-transition-duration) forwards;
147+
animation-timing-function: var(--f7-sheet-transition-timing-function);
139148
}
140149
}
141150
});
@@ -162,6 +171,7 @@ html.with-modal-sheet-push {
162171
.framework7-root > .view.dark {
163172
&:after {
164173
animation: sheet-dark-push-overlay-fade-out var(--f7-sheet-transition-duration) forwards;
174+
animation-timing-function: var(--f7-sheet-transition-timing-function);
165175
}
166176
}
167177
}

0 commit comments

Comments
 (0)