|
| 1 | +@import '../src/ui-guide-variables'; |
| 2 | + |
| 3 | +$theme-color: rgb(77, 168, 100) !default; |
| 4 | +$popup-arrow-size: 8px; |
| 5 | +$box-gutter-size: 8px !default; |
| 6 | +$box-border-size: 3px !default; |
| 7 | + |
| 8 | +[uig-highlight-box] { |
| 9 | + box-sizing: content-box !important; |
| 10 | + border: $box-border-size solid lighten($theme-color, 5%); |
| 11 | + border-radius: 0.25rem; |
| 12 | + box-shadow: 0 0 0 999rem lighten(rgba($theme-color, 0.15), 10%), |
| 13 | + 0 0 0.25rem rgba($theme-color, 0.3); |
| 14 | + opacity: 0; |
| 15 | + will-change: padding, margin, opacity; |
| 16 | + |
| 17 | + &[uig-show] { |
| 18 | + animation: shrink 0.3s 0.2s forwards; |
| 19 | + |
| 20 | + @keyframes shrink { |
| 21 | + from { |
| 22 | + opacity: 0; |
| 23 | + padding: $box-gutter-size + 30px; |
| 24 | + margin: -$box-gutter-size - $box-border-size - 30px; |
| 25 | + } |
| 26 | + |
| 27 | + to { |
| 28 | + opacity: 1; |
| 29 | + padding: $box-gutter-size; |
| 30 | + margin: -$box-gutter-size - $box-border-size; |
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +[uig-popup-wrapper] { |
| 37 | + position: relative; |
| 38 | + display: flex; |
| 39 | + max-width: 450px; |
| 40 | + opacity: 0; |
| 41 | + will-change: opacity, transform; |
| 42 | + |
| 43 | + [uig-popup][uig-show][x-placement='top'] & { |
| 44 | + animation: slide-top 0.2s 0.3s ease-out forwards; |
| 45 | + |
| 46 | + @keyframes slide-top { |
| 47 | + from { |
| 48 | + transform: translateY(30px); |
| 49 | + opacity: 0; |
| 50 | + } |
| 51 | + |
| 52 | + to { |
| 53 | + transform: translateY(0); |
| 54 | + opacity: 1; |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + [uig-popup][uig-show][x-placement='right'] & { |
| 60 | + animation: slide-right 0.2s 0.3s ease-out forwards; |
| 61 | + |
| 62 | + @keyframes slide-right { |
| 63 | + from { |
| 64 | + transform: translateX(-30px); |
| 65 | + opacity: 0; |
| 66 | + } |
| 67 | + |
| 68 | + to { |
| 69 | + transform: translateX(0); |
| 70 | + opacity: 1; |
| 71 | + } |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + [uig-popup][uig-show][x-placement='bottom'] & { |
| 76 | + animation: slide-bottom 0.2s 0.3s ease-out forwards; |
| 77 | + |
| 78 | + @keyframes slide-bottom { |
| 79 | + from { |
| 80 | + transform: translateY(-30px); |
| 81 | + opacity: 0; |
| 82 | + } |
| 83 | + |
| 84 | + to { |
| 85 | + transform: translateY(0); |
| 86 | + opacity: 1; |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + [uig-popup][uig-show][x-placement='left'] & { |
| 92 | + animation: slide-left 0.2s 0.3s ease-out forwards; |
| 93 | + |
| 94 | + @keyframes slide-left { |
| 95 | + from { |
| 96 | + transform: translateX(30px); |
| 97 | + opacity: 0; |
| 98 | + } |
| 99 | + |
| 100 | + to { |
| 101 | + transform: translateX(0); |
| 102 | + opacity: 1; |
| 103 | + } |
| 104 | + } |
| 105 | + } |
| 106 | +} |
| 107 | + |
| 108 | +span[x-arrow] { |
| 109 | + position: absolute; |
| 110 | + z-index: 2; |
| 111 | + display: inline-block; |
| 112 | + border: $popup-arrow-size solid transparent; |
| 113 | + |
| 114 | + [uig-popup][x-placement='bottom'] & { |
| 115 | + top: $box-gutter-size + $box-border-size; |
| 116 | + border-bottom-color: darken($theme-color, 5%); |
| 117 | + } |
| 118 | + |
| 119 | + [uig-popup][x-placement='top'] & { |
| 120 | + bottom: $box-gutter-size + $box-border-size; |
| 121 | + border-top-color: darken($theme-color, 5%); |
| 122 | + } |
| 123 | + |
| 124 | + [uig-popup][x-placement='right'] & { |
| 125 | + left: $box-gutter-size + $box-border-size; |
| 126 | + border-right-color: darken($theme-color, 5%); |
| 127 | + } |
| 128 | + |
| 129 | + [uig-popup][x-placement='left'] & { |
| 130 | + right: $box-gutter-size + $box-border-size; |
| 131 | + border-left-color: darken($theme-color, 5%); |
| 132 | + } |
| 133 | +} |
| 134 | + |
| 135 | +[uig-popup-card] { |
| 136 | + position: relative; |
| 137 | + z-index: 1; |
| 138 | + display: flex; |
| 139 | + flex-direction: column; |
| 140 | + padding: 0.75rem; |
| 141 | + background-color: $theme-color; |
| 142 | + color: #fff; |
| 143 | + border-radius: 0.2rem; |
| 144 | + overflow: hidden; |
| 145 | + |
| 146 | + [uig-popup][x-placement='bottom'] & { |
| 147 | + margin-top: ($popup-arrow-size * 2) + $box-gutter-size + $box-border-size; |
| 148 | + } |
| 149 | + |
| 150 | + [uig-popup][x-placement='top'] & { |
| 151 | + margin-bottom: ($popup-arrow-size * 2) + $box-gutter-size + $box-border-size; |
| 152 | + } |
| 153 | + |
| 154 | + [uig-popup][x-placement='right'] & { |
| 155 | + margin-left: ($popup-arrow-size * 2) + $box-gutter-size + $box-border-size; |
| 156 | + } |
| 157 | + |
| 158 | + [uig-popup][x-placement='left'] & { |
| 159 | + margin-right: ($popup-arrow-size * 2) + $box-gutter-size + $box-border-size; |
| 160 | + } |
| 161 | +} |
0 commit comments