|
1 | 1 | @use '../../../styling/utils'; |
2 | 2 |
|
| 3 | +$menu-roll-duration: 170ms; |
| 4 | +$menu-roll-ease: cubic-bezier(0.22, 1, 0.36, 1); |
| 5 | + |
3 | 6 | @keyframes str-chat-context-menu-roll-in-from-left { |
4 | 7 | from { |
5 | 8 | opacity: 0.12; |
|
74 | 77 |
|
75 | 78 | .str-chat { |
76 | 79 | --str-chat__dialog-menu-button-hover-background-color: var(--background-utility-hover); |
77 | | - --str-chat__menu-roll-duration: 170ms; |
78 | | - --str-chat__menu-roll-ease: cubic-bezier(0.22, 1, 0.36, 1); |
79 | 80 |
|
80 | 81 | .str-chat__context-menu { |
81 | 82 | background: var(--background-core-elevation-2); |
|
236 | 237 | } |
237 | 238 |
|
238 | 239 | [data-str-chat-placement^='right'] > .str-chat__context-menu { |
239 | | - animation: str-chat-context-menu-roll-in-from-left |
240 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 240 | + animation: str-chat-context-menu-roll-in-from-left $menu-roll-duration $menu-roll-ease; |
241 | 241 | transform-origin: left center; |
242 | 242 | } |
243 | 243 |
|
244 | 244 | [data-str-chat-placement^='left'] > .str-chat__context-menu { |
245 | | - animation: str-chat-context-menu-roll-in-from-right |
246 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 245 | + animation: str-chat-context-menu-roll-in-from-right $menu-roll-duration |
| 246 | + $menu-roll-ease; |
247 | 247 | transform-origin: right center; |
248 | 248 | } |
249 | 249 |
|
250 | 250 | [data-str-chat-placement^='bottom'] > .str-chat__context-menu { |
251 | | - animation: str-chat-context-menu-roll-in-from-bottom |
252 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 251 | + animation: str-chat-context-menu-roll-in-from-bottom $menu-roll-duration |
| 252 | + $menu-roll-ease; |
253 | 253 | transform-origin: center top; |
254 | 254 | } |
255 | 255 |
|
256 | 256 | [data-str-chat-placement^='top'] > .str-chat__context-menu { |
257 | | - animation: str-chat-context-menu-roll-in-from-top |
258 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 257 | + animation: str-chat-context-menu-roll-in-from-top $menu-roll-duration $menu-roll-ease; |
259 | 258 | transform-origin: center bottom; |
260 | 259 | } |
261 | 260 |
|
262 | 261 | [data-str-chat-dialog-state='closing'][data-str-chat-placement^='right'] |
263 | 262 | > .str-chat__context-menu { |
264 | | - animation: str-chat-context-menu-roll-in-from-left |
265 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease) reverse |
266 | | - forwards; |
| 263 | + animation: str-chat-context-menu-roll-in-from-left $menu-roll-duration $menu-roll-ease |
| 264 | + reverse forwards; |
267 | 265 | transform-origin: left center; |
268 | 266 | } |
269 | 267 |
|
270 | 268 | [data-str-chat-dialog-state='closing'][data-str-chat-placement^='left'] |
271 | 269 | > .str-chat__context-menu { |
272 | | - animation: str-chat-context-menu-roll-in-from-right |
273 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease) reverse |
274 | | - forwards; |
| 270 | + animation: str-chat-context-menu-roll-in-from-right $menu-roll-duration |
| 271 | + $menu-roll-ease reverse forwards; |
275 | 272 | transform-origin: right center; |
276 | 273 | } |
277 | 274 |
|
278 | 275 | [data-str-chat-dialog-state='closing'][data-str-chat-placement^='bottom'] |
279 | 276 | > .str-chat__context-menu { |
280 | | - animation: str-chat-context-menu-roll-in-from-bottom |
281 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease) reverse |
282 | | - forwards; |
| 277 | + animation: str-chat-context-menu-roll-in-from-bottom $menu-roll-duration |
| 278 | + $menu-roll-ease reverse forwards; |
283 | 279 | transform-origin: center top; |
284 | 280 | } |
285 | 281 |
|
286 | 282 | [data-str-chat-dialog-state='closing'][data-str-chat-placement^='top'] |
287 | 283 | > .str-chat__context-menu { |
288 | | - animation: str-chat-context-menu-roll-in-from-top |
289 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease) reverse |
290 | | - forwards; |
| 284 | + animation: str-chat-context-menu-roll-in-from-top $menu-roll-duration $menu-roll-ease |
| 285 | + reverse forwards; |
291 | 286 | transform-origin: center bottom; |
292 | 287 | } |
293 | 288 |
|
|
297 | 292 | [data-str-chat-roll-from] |
298 | 293 | )[data-str-chat-roll-axis='x'][data-str-chat-placement^='left'] |
299 | 294 | > .str-chat__context-menu { |
300 | | - animation: str-chat-context-menu-roll-in-from-right |
301 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 295 | + animation: str-chat-context-menu-roll-in-from-right $menu-roll-duration |
| 296 | + $menu-roll-ease; |
302 | 297 | transform-origin: right center; |
303 | 298 | } |
304 | 299 |
|
305 | 300 | .str-chat__context-menu__submenu-container:not( |
306 | 301 | [data-str-chat-roll-from] |
307 | 302 | )[data-str-chat-roll-axis='x']:not([data-str-chat-placement^='left']) |
308 | 303 | > .str-chat__context-menu { |
309 | | - animation: str-chat-context-menu-roll-in-from-left |
310 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 304 | + animation: str-chat-context-menu-roll-in-from-left $menu-roll-duration $menu-roll-ease; |
311 | 305 | transform-origin: left center; |
312 | 306 | } |
313 | 307 |
|
314 | 308 | .str-chat__context-menu__submenu-container[data-str-chat-roll-from='left'] |
315 | 309 | > .str-chat__context-menu { |
316 | | - animation: str-chat-context-menu-roll-in-from-left |
317 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 310 | + animation: str-chat-context-menu-roll-in-from-left $menu-roll-duration $menu-roll-ease; |
318 | 311 | transform-origin: left center; |
319 | 312 | } |
320 | 313 |
|
321 | 314 | .str-chat__context-menu__submenu-container[data-str-chat-roll-from='right'] |
322 | 315 | > .str-chat__context-menu { |
323 | | - animation: str-chat-context-menu-roll-in-from-right |
324 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 316 | + animation: str-chat-context-menu-roll-in-from-right $menu-roll-duration |
| 317 | + $menu-roll-ease; |
325 | 318 | transform-origin: right center; |
326 | 319 | } |
327 | 320 |
|
328 | 321 | .str-chat__context-menu__submenu-container[data-str-chat-roll-from='top'] |
329 | 322 | > .str-chat__context-menu { |
330 | | - animation: str-chat-context-menu-roll-in-from-top |
331 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 323 | + animation: str-chat-context-menu-roll-in-from-top $menu-roll-duration $menu-roll-ease; |
332 | 324 | transform-origin: center top; |
333 | 325 | } |
334 | 326 |
|
335 | 327 | .str-chat__context-menu__submenu-container[data-str-chat-roll-from='bottom'] |
336 | 328 | > .str-chat__context-menu { |
337 | | - animation: str-chat-context-menu-roll-in-from-bottom |
338 | | - var(--str-chat__menu-roll-duration, 130ms) var(--str-chat__menu-roll-ease); |
| 329 | + animation: str-chat-context-menu-roll-in-from-bottom $menu-roll-duration |
| 330 | + $menu-roll-ease; |
339 | 331 | transform-origin: center bottom; |
340 | 332 | } |
341 | 333 |
|
|
0 commit comments