|
1 | 1 | /* === FAB === */
|
2 | 2 | @import url('./fab-vars.less');
|
| 3 | + |
| 4 | +.left-fabs(@ruleset) { |
| 5 | + .fab-left-top, |
| 6 | + .fab-left-center, |
| 7 | + .fab-left-bottom { |
| 8 | + @ruleset(); |
| 9 | + } |
| 10 | +} |
| 11 | +.right-fabs(@ruleset) { |
| 12 | + .fab-right-top, |
| 13 | + .fab-right-center, |
| 14 | + .fab-right-bottom { |
| 15 | + @ruleset(); |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +.top-fabs(@ruleset) { |
| 20 | + .fab-left-top, |
| 21 | + .fab-center-top, |
| 22 | + .fab-right-top { |
| 23 | + @ruleset(); |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +.bottom-fabs(@ruleset) { |
| 28 | + .fab-left-bottom, |
| 29 | + .fab-center-bottom, |
| 30 | + .fab-right-bottom { |
| 31 | + @ruleset(); |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +.vertical-center-fabs(@ruleset) { |
| 36 | + .fab-center-top, |
| 37 | + .fab-center-center, |
| 38 | + .fab-center-bottom { |
| 39 | + @ruleset(); |
| 40 | + } |
| 41 | +} |
| 42 | +.horizontal-center-fabs(@ruleset) { |
| 43 | + .fab-left-center, |
| 44 | + .fab-center-center, |
| 45 | + .fab-right-center { |
| 46 | + @ruleset(); |
| 47 | + } |
| 48 | +} |
| 49 | + |
3 | 50 | .fab-backdrop {
|
4 | 51 | z-index: 1400;
|
5 | 52 | }
|
|
10 | 57 | --f7-touch-ripple-color: var(--f7-touch-ripple-white);
|
11 | 58 | }
|
12 | 59 | }
|
13 |
| -.fab[class*="fab-left"] { |
| 60 | +.left-fabs({ |
14 | 61 | left: calc(var(--f7-fab-margin) + var(--f7-safe-area-left));
|
15 |
| -} |
16 |
| -.fab[class*="fab-right"] { |
| 62 | +}); |
| 63 | +.right-fabs({ |
17 | 64 | right: calc(var(--f7-fab-margin) + var(--f7-safe-area-right));
|
18 |
| -} |
19 |
| -.fab[class*="-top"] { |
| 65 | +}); |
| 66 | +.top-fabs({ |
20 | 67 | top: var(--f7-fab-margin);
|
21 |
| -} |
22 |
| -.fab[class*="-bottom"] { |
| 68 | +}); |
| 69 | +.bottom-fabs({ |
23 | 70 | bottom: calc(var(--f7-fab-margin) + var(--f7-safe-area-bottom));
|
24 |
| -} |
25 |
| -.fab[class*="fab-center"] { |
| 71 | +}); |
| 72 | + |
| 73 | +.vertical-center-fabs({ |
26 | 74 | left: 50%;
|
27 | 75 | transform: translateX(-50%);
|
28 |
| -} |
29 |
| -.fab[class*="left-center"], |
30 |
| -.fab[class*="right-center"] { |
| 76 | +}); |
| 77 | + |
| 78 | +.horizontal-center-fabs({ |
31 | 79 | top: 50%;
|
32 | 80 | transform: translateY(-50%);
|
33 |
| -} |
34 |
| -.fab[class*="center-center"] { |
| 81 | +}); |
| 82 | + |
| 83 | +.fab-center-center { |
35 | 84 | top: 50%;
|
36 | 85 | left: 50%;
|
37 | 86 | transform: translateX(-50%) translateY(-50%);
|
|
286 | 335 | pointer-events: none;
|
287 | 336 | font-size: var(--f7-fab-label-font-size);
|
288 | 337 | }
|
289 |
| -.fab[class*="fab-right-"] { |
| 338 | +.right-fabs({ |
290 | 339 | .fab-label {
|
291 | 340 | right: 100%;
|
292 | 341 | margin-right: 8px;
|
293 | 342 | }
|
294 |
| -} |
295 |
| -.fab[class*="fab-left-"] { |
| 343 | +}); |
| 344 | +.left-fabs({ |
296 | 345 | .fab-label {
|
297 | 346 | left: 100%;
|
298 | 347 | margin-left: 8px;
|
299 | 348 | }
|
300 |
| -} |
| 349 | +}); |
301 | 350 |
|
302 | 351 | // Relation with navbar
|
303 |
| -.navbar ~ * .fab[class*="-top"], |
304 |
| -.navbar ~ .fab[class*="-top"], |
305 |
| -.navbars ~ * .fab[class*="-top"], |
306 |
| -.navbars ~ .fab[class*="-top"] { |
| 352 | +.navbar ~ * .fab-left-top, |
| 353 | +.navbar ~ * .fab-center-top, |
| 354 | +.navbar ~ * .fab-right-top, |
| 355 | +.navbar ~ .fab-left-top, |
| 356 | +.navbar ~ .fab-center-top, |
| 357 | +.navbar ~ .fab-right-top, |
| 358 | +.navbars ~ * .fab-left-top, |
| 359 | +.navbars ~ * .fab-center-top, |
| 360 | +.navbars ~ * .fab-right-top, |
| 361 | +.navbars ~ .fab-left-top, |
| 362 | +.navbars ~ .fab-center-top, |
| 363 | +.navbars ~ .fab-right-top { |
307 | 364 | margin-top: calc(var(--f7-navbar-height) + var(--f7-safe-area-top));
|
308 | 365 | }
|
309 | 366 | // Relation with toolbar
|
310 |
| -.toolbar-top ~ * .fab[class*="-top"], |
311 |
| -.toolbar-top ~ .fab[class*="-top"], |
312 |
| -.ios .toolbar-top-ios ~ * .fab[class*="-top"], |
313 |
| -.ios .toolbar-top-ios ~ .fab[class*="-top"], |
314 |
| -.md .toolbar-top-md ~ * .fab[class*="-top"], |
315 |
| -.md .toolbar-top-md ~ .fab[class*="-top"] { |
| 367 | +.toolbar-top ~ * .fab-left-top, |
| 368 | +.toolbar-top ~ * .fab-center-top, |
| 369 | +.toolbar-top ~ * .fab-right-top, |
| 370 | +.toolbar-top ~ .fab-left-top, |
| 371 | +.toolbar-top ~ .fab-center-top, |
| 372 | +.toolbar-top ~ .fab-right-top, |
| 373 | +.ios .toolbar-top-ios ~ * .fab-left-top, |
| 374 | +.ios .toolbar-top-ios ~ * .fab-center-top, |
| 375 | +.ios .toolbar-top-ios ~ * .fab-right-top, |
| 376 | +.ios .toolbar-top-ios ~ .fab-left-top, |
| 377 | +.ios .toolbar-top-ios ~ .fab-center-top, |
| 378 | +.ios .toolbar-top-ios ~ .fab-right-top, |
| 379 | +.md .toolbar-top-md ~ * .fab-left-top, |
| 380 | +.md .toolbar-top-md ~ * .fab-center-top, |
| 381 | +.md .toolbar-top-md ~ * .fab-right-top, |
| 382 | +.md .toolbar-top-md ~ .fab-left-top, |
| 383 | +.md .toolbar-top-md ~ .fab-center-top, |
| 384 | +.md .toolbar-top-md ~ .fab-right-top { |
316 | 385 | margin-top: var(--f7-toolbar-height);
|
317 | 386 | }
|
318 |
| -.toolbar-bottom ~ * .fab[class*="-bottom"], |
319 |
| -.toolbar-bottom ~ .fab[class*="-bottom"], |
320 |
| -.ios .toolbar-bottom-ios ~ * .fab[class*="-bottom"], |
321 |
| -.ios .toolbar-bottom-ios ~ .fab[class*="-bottom"], |
322 |
| -.md .toolbar-bottom-md ~ * .fab[class*="-bottom"], |
323 |
| -.md .toolbar-bottom-md ~ .fab[class*="-bottom"] { |
| 387 | +.toolbar-bottom ~ * .fab-left-bottom, |
| 388 | +.toolbar-bottom ~ * .fab-center-bottom, |
| 389 | +.toolbar-bottom ~ * .fab-right-bottom, |
| 390 | +.toolbar-bottom ~ .fab-left-bottom, |
| 391 | +.toolbar-bottom ~ .fab-center-bottom, |
| 392 | +.toolbar-bottom ~ .fab-right-bottom, |
| 393 | +.ios .toolbar-bottom-ios ~ * .fab-left-bottom, |
| 394 | +.ios .toolbar-bottom-ios ~ * .fab-center-bottom, |
| 395 | +.ios .toolbar-bottom-ios ~ * .fab-right-bottom, |
| 396 | +.ios .toolbar-bottom-ios ~ .fab-left-bottom, |
| 397 | +.ios .toolbar-bottom-ios ~ .fab-center-bottom, |
| 398 | +.ios .toolbar-bottom-ios ~ .fab-right-bottom, |
| 399 | +.md .toolbar-bottom-md ~ * .fab-left-bottom, |
| 400 | +.md .toolbar-bottom-md ~ * .fab-center-bottom, |
| 401 | +.md .toolbar-bottom-md ~ * .fab-right-bottom, |
| 402 | +.md .toolbar-bottom-md ~ .fab-left-bottom, |
| 403 | +.md .toolbar-bottom-md ~ .fab-center-bottom, |
| 404 | +.md .toolbar-bottom-md ~ .fab-right-bottom { |
324 | 405 | margin-bottom: var(--f7-toolbar-height);
|
325 | 406 | }
|
326 |
| -.tabbar-labels.toolbar-bottom ~ * .fab[class*="-bottom"], |
327 |
| -.tabbar-labels.toolbar-bottom ~ .fab[class*="-bottom"], |
328 |
| -.ios .tabbar-labels.toolbar-bottom-ios ~ * .fab[class*="-bottom"], |
329 |
| -.ios .tabbar-labels.toolbar-bottom-ios ~ .fab[class*="-bottom"], |
330 |
| -.md .tabbar-labels.toolbar-bottom-md ~ * .fab[class*="-bottom"], |
331 |
| -.md .tabbar-labels.toolbar-bottom-md ~ .fab[class*="-bottom"] { |
| 407 | +.tabbar-labels.toolbar-bottom ~ * .fab-left-bottom, |
| 408 | +.tabbar-labels.toolbar-bottom ~ * .fab-center-bottom, |
| 409 | +.tabbar-labels.toolbar-bottom ~ * .fab-right-bottom, |
| 410 | +.tabbar-labels.toolbar-bottom ~ .fab-left-bottom, |
| 411 | +.tabbar-labels.toolbar-bottom ~ .fab-center-bottom, |
| 412 | +.tabbar-labels.toolbar-bottom ~ .fab-right-bottom, |
| 413 | +.ios .tabbar-labels.toolbar-bottom-ios ~ * .fab-left-bottom, |
| 414 | +.ios .tabbar-labels.toolbar-bottom-ios ~ * .fab-center-bottom, |
| 415 | +.ios .tabbar-labels.toolbar-bottom-ios ~ * .fab-right-bottom, |
| 416 | +.ios .tabbar-labels.toolbar-bottom-ios ~ .fab-left-bottom, |
| 417 | +.ios .tabbar-labels.toolbar-bottom-ios ~ .fab-center-bottom, |
| 418 | +.ios .tabbar-labels.toolbar-bottom-ios ~ .fab-right-bottom, |
| 419 | +.md .tabbar-labels.toolbar-bottom-md ~ * .fab-left-bottom, |
| 420 | +.md .tabbar-labels.toolbar-bottom-md ~ * .fab-center-bottom, |
| 421 | +.md .tabbar-labels.toolbar-bottom-md ~ * .fab-right-bottom, |
| 422 | +.md .tabbar-labels.toolbar-bottom-md ~ .fab-left-bottom, |
| 423 | +.md .tabbar-labels.toolbar-bottom-md ~ .fab-center-bottom, |
| 424 | +.md .tabbar-labels.toolbar-bottom-md ~ .fab-right-bottom { |
332 | 425 | margin-bottom: var(--f7-tabbar-labels-height);
|
333 | 426 | }
|
334 |
| -.tabbar-labels.toolbar-top ~ * .fab[class*="-bottom"], |
335 |
| -.tabbar-labels.toolbar-top ~ .fab[class*="-bottom"], |
336 |
| -.ios .tabbar-labels.toolbar-top-ios ~ * .fab[class*="-bottom"], |
337 |
| -.ios .tabbar-labels.toolbar-top-ios ~ .fab[class*="-bottom"], |
338 |
| -.md .tabbar-labels.toolbar-top-md ~ * .fab[class*="-bottom"], |
339 |
| -.md .tabbar-labels.toolbar-top-md ~ .fab[class*="-bottom"] { |
| 427 | +.tabbar-labels.toolbar-top ~ * .fab-left-bottom, |
| 428 | +.tabbar-labels.toolbar-top ~ * .fab-center-bottom, |
| 429 | +.tabbar-labels.toolbar-top ~ * .fab-right-bottom, |
| 430 | +.tabbar-labels.toolbar-top ~ .fab-left-bottom, |
| 431 | +.tabbar-labels.toolbar-top ~ .fab-center-bottom, |
| 432 | +.tabbar-labels.toolbar-top ~ .fab-right-bottom, |
| 433 | +.ios .tabbar-labels.toolbar-top-ios ~ * .fab-left-bottom, |
| 434 | +.ios .tabbar-labels.toolbar-top-ios ~ * .fab-center-bottom, |
| 435 | +.ios .tabbar-labels.toolbar-top-ios ~ * .fab-right-bottom, |
| 436 | +.ios .tabbar-labels.toolbar-top-ios ~ .fab-left-bottom, |
| 437 | +.ios .tabbar-labels.toolbar-top-ios ~ .fab-center-bottom, |
| 438 | +.ios .tabbar-labels.toolbar-top-ios ~ .fab-right-bottom, |
| 439 | +.md .tabbar-labels.toolbar-top-md ~ * .fab-left-bottom, |
| 440 | +.md .tabbar-labels.toolbar-top-md ~ * .fab-center-bottom, |
| 441 | +.md .tabbar-labels.toolbar-top-md ~ * .fab-right-bottom, |
| 442 | +.md .tabbar-labels.toolbar-top-md ~ .fab-left-bottom, |
| 443 | +.md .tabbar-labels.toolbar-top-md ~ .fab-center-bottom, |
| 444 | +.md .tabbar-labels.toolbar-top-md ~ .fab-right-bottom { |
340 | 445 | margin-top: var(--f7-tabbar-labels-height);
|
341 | 446 | }
|
342 | 447 |
|
343 |
| -.messagebar ~ * .fab[class*="-bottom"], |
344 |
| -.messagebar ~ .fab[class*="-bottom"] { |
| 448 | +.messagebar ~ * .fab-left-bottom, |
| 449 | +.messagebar ~ * .fab-center-bottom, |
| 450 | +.messagebar ~ * .fab-right-bottom, |
| 451 | +.messagebar ~ .fab-left-bottom, |
| 452 | +.messagebar ~ .fab-center-bottom, |
| 453 | +.messagebar ~ .fab-right-bottom { |
345 | 454 | margin-bottom: var(--f7-messagebar-height);
|
346 | 455 | }
|
347 | 456 |
|
348 | 457 | .navbar {
|
349 | 458 | + .toolbar-top,
|
350 | 459 | .ios & + .toolbar-top-ios,
|
351 | 460 | .md & + .toolbar-top-ios {
|
352 |
| - ~ * .fab[class*="-top"], |
353 |
| - ~ .fab[class*="-top"] { |
| 461 | + ~ * .fab-left-top, |
| 462 | + ~ * .fab-center-top, |
| 463 | + ~ * .fab-right-top, |
| 464 | + ~ .fab-left-top, |
| 465 | + ~ .fab-center-top, |
| 466 | + ~ .fab-right-top { |
354 | 467 | margin-top: calc(var(--f7-toolbar-height) + var(--f7-navbar-height) + var(--f7-safe-area-top));
|
355 | 468 | }
|
356 | 469 | }
|
357 | 470 | + .toolbar-top.tabbar-labels,
|
358 | 471 | .ios & + .toolbar-top-ios.tabbar-labels,
|
359 | 472 | .md & + .toolbar-top-ios.tabbar-labels {
|
360 |
| - ~ * .fab[class*="-top"], |
361 |
| - ~ .fab[class*="-top"] { |
| 473 | + ~ * .fab-left-top, |
| 474 | + ~ * .fab-center-top, |
| 475 | + ~ * .fab-right-top, |
| 476 | + ~ .fab-left-top, |
| 477 | + ~ .fab-center-top, |
| 478 | + ~ .fab-right-top { |
362 | 479 | margin-top: calc(var(--f7-tabbar-labels-height) + var(--f7-navbar-height) + var(--f7-safe-area-top));
|
363 | 480 | }
|
364 | 481 | }
|
365 | 482 | }
|
366 | 483 | .navbars {
|
367 | 484 | + .toolbar-top,
|
368 | 485 | .ios & + .toolbar-top-ios {
|
369 |
| - ~ * .fab[class*="-top"], |
370 |
| - ~ .fab[class*="-top"] { |
| 486 | + ~ * .fab-left-top, |
| 487 | + ~ * .fab-center-top, |
| 488 | + ~ * .fab-right-top, |
| 489 | + ~ .fab-left-top, |
| 490 | + ~ .fab-center-top, |
| 491 | + ~ .fab-right-top { |
371 | 492 | margin-top: calc(var(--f7-toolbar-height) + var(--f7-navbar-height) + var(--f7-safe-area-top));
|
372 | 493 | }
|
373 | 494 | }
|
374 | 495 | + .toolbar-top.tabbar-labels,
|
375 | 496 | .ios & + .toolbar-top-ios.tabbar-labels {
|
376 |
| - ~ * .fab[class*="-top"], |
377 |
| - ~ .fab[class*="-top"] { |
| 497 | + ~ * .fab-left-top, |
| 498 | + ~ * .fab-center-top, |
| 499 | + ~ * .fab-right-top, |
| 500 | + ~ .fab-left-top, |
| 501 | + ~ .fab-center-top, |
| 502 | + ~ .fab-right-top { |
378 | 503 | margin-top: calc(var(--f7-tabbar-labels-height) + var(--f7-navbar-height) + var(--f7-safe-area-top));
|
379 | 504 | }
|
380 | 505 | }
|
|
0 commit comments