_Bookmarks.scss 8.68 KB
Newer Older
1 2 3
@mixin bookmarks() {
  $bookmarks-height--loading: 150px !default;
  $bookmarks-thumbnail-size: 64px !default;
杨思琦's avatar
杨思琦 committed
4 5 6

  @include loopingProgressBar(".esri-bookmarks__bookmark--active");

7 8
  .esri-bookmarks {
    background-color: transparent;
杨思琦's avatar
杨思琦 committed
9

10 11 12
    .esri-widget__content--empty {
      background-color: $background-color--offset;
    }
杨思琦's avatar
杨思琦 committed
13 14 15 16 17 18 19

    .esri-button-menu {
      position: absolute;
      right: 2px;
      bottom: 2px;
      z-index: 1;
    }
20 21 22 23 24 25
  }

  .esri-bookmarks__loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
杨思琦's avatar
杨思琦 committed
26 27
    padding: 0;
    height: $bookmarks-height--loading;
28 29 30
  }

  .esri-bookmarks__loader {
杨思琦's avatar
杨思琦 committed
31
    background: url("../base/images/loading-throb.gif") no-repeat center center;
32
    width: 100%;
杨思琦's avatar
杨思琦 committed
33
    height: 64px;
34 35 36 37 38 39
  }

  .esri-bookmarks__list {
    display: block;
    margin: 0;
    padding: 0;
杨思琦's avatar
杨思琦 committed
40
    list-style: none;
41 42 43
  }

  .esri-bookmarks__bookmark {
杨思琦's avatar
杨思琦 committed
44 45
    display: flex;
    position: relative;
46
    align-items: center;
杨思琦's avatar
杨思琦 committed
47 48 49
    transition:
      background-color 250ms ease-in-out,
      color 250ms ease-in-out;
50
    border-bottom: 1px solid $border-color--subtle;
51 52 53 54 55 56
    background-color: $background-color;
    overflow: hidden;
  }

  .esri-bookmarks__bookmark.sortable-chosen {
    transition: background-color 250ms ease-in-out;
杨思琦's avatar
杨思琦 committed
57
    background-color: $background-color--active;
58 59 60
  }

  .esri-bookmarks__bookmark-button {
杨思琦's avatar
杨思琦 committed
61 62 63 64 65
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
66 67
    border: none;
    background-color: transparent;
杨思琦's avatar
杨思琦 committed
68
    cursor: pointer;
69
    padding: 0;
70
    padding-inline-start: $side-spacing--half;
杨思琦's avatar
杨思琦 committed
71 72
    overflow: hidden;
    text-align: initial;
73
    color: $interactive-font-color;
74 75
    font-family: $font-family;
    font-weight: $font-weight--regular;
杨思琦's avatar
杨思琦 committed
76

77 78 79 80
    &:hover {
      background-color: $background-color--hover;
      color: $interactive-font-color--hover;
    }
杨思琦's avatar
杨思琦 committed
81

82 83 84 85
    &:hover:active {
      background-color: transparent;
      color: $interactive-font-color;
    }
86 87
  }

88
  .esri-bookmarks__list--sortable .esri-bookmarks__bookmark-button {
杨思琦's avatar
杨思琦 committed
89
    padding-inline-start: 0;
90 91
  }

92
  .esri-bookmarks_bookmark-drag-handle {
杨思琦's avatar
杨思琦 committed
93 94
    display: flex;
    flex: 0 0 auto;
95 96
    align-items: center;
    align-self: stretch;
杨思琦's avatar
杨思琦 committed
97 98 99
    justify-content: center;
    transition: background-color 250ms ease-in-out;
    margin: 0;
100
    border: none;
杨思琦's avatar
杨思琦 committed
101
    background-color: transparent;
102
    cursor: move;
103
    padding: 0 $side-spacing--quarter;
杨思琦's avatar
杨思琦 committed
104 105
    color: $font-color--placeholder;

106 107
    &:focus,
    &:hover {
108
      background-color: $background-color--hover;
109 110 111 112 113
      color: $interactive-font-color--hover;
    }
  }

  .esri-bookmarks_bookmark-drag-handle[aria-pressed="true"] {
114 115
    background-color: $background-color--active;
    color: $interactive-font-color--hover;
116 117 118 119 120
  }

  .esri-bookmarks__bookmark--active {
    background-color: $background-color--active;
    cursor: default;
杨思琦's avatar
杨思琦 committed
121 122
    color: $font-color;

123 124 125 126
    &:hover,
    &:focus {
      background-color: $background-color--active;
      cursor: default;
杨思琦's avatar
杨思琦 committed
127
      color: $font-color;
128 129 130
    }
  }

131 132 133
  .esri-bookmarks__bookmark-label {
    display: flex;
    flex: 1 1 auto;
杨思琦's avatar
杨思琦 committed
134 135
    flex-flow: column;
    padding: $cap-spacing $side-spacing--three-quarters;
136 137
  }

138 139
  .esri-bookmarks__bookmark-name {
    flex: 1;
140
    padding: 0;
杨思琦's avatar
杨思琦 committed
141
    overflow: hidden;
142
    word-break: break-word;
杨思琦's avatar
杨思琦 committed
143 144 145
    color: $font-color;
    font-size: $font-size--small;
    overflow-wrap: break-word; /* Firefox */
146 147
  }

148 149 150
  .esri-bookmarks__bookmark-time-extent {
    flex: 1;
    padding: 0;
杨思琦's avatar
杨思琦 committed
151
    overflow: hidden;
152
    word-break: break-word;
杨思琦's avatar
杨思琦 committed
153 154
    font-size: $font-size--small;
    overflow-wrap: break-word; /* Firefox */
155 156 157 158 159 160
  }

  .esri-bookmarks__time-extent {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: $side-spacing--half;
杨思琦's avatar
杨思琦 committed
161
    margin-top: $cap-spacing--quarter;
162 163
  }

164 165
  .esri-bookmarks__bookmark-image-container {
    display: flex;
杨思琦's avatar
杨思琦 committed
166
    position: relative;
167
    flex: 0 0 auto;
杨思琦's avatar
杨思琦 committed
168
    align-items: center;
169 170 171 172
    justify-content: center;
    max-width: $button-width--double;
  }

杨思琦's avatar
杨思琦 committed
173 174
  .esri-bookmarks__bookmark-image-container--has-image {
    overflow: hidden;
175 176 177 178
  }

  .esri-bookmarks__image {
    margin: $cap-spacing--half 0;
杨思琦's avatar
杨思琦 committed
179 180
    background-color: $background-color--offset;
    width: $bookmarks-thumbnail-size;
181 182
  }

183 184 185 186
  .esri-bookmarks__bookmark-edit-button-container {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
杨思琦's avatar
杨思琦 committed
187
    align-self: stretch;
188 189
  }

190
  .esri-bookmarks__bookmark-edit-button {
杨思琦's avatar
杨思琦 committed
191
    display: flex;
192 193
    align-items: center;
    border: none;
杨思琦's avatar
杨思琦 committed
194
    background-color: transparent;
195
    cursor: pointer;
196
    padding: 0 $side-spacing;
杨思琦's avatar
杨思琦 committed
197 198
    color: $interactive-font-color;

199
    &:hover {
200
      background-color: $background-color--hover;
201 202 203 204
      color: $interactive-font-color--hover;
    }
  }

205
  .esri-bookmarks__time-extent-container {
杨思琦's avatar
杨思琦 committed
206 207
    --calcite-label-margin-bottom: 0;

208 209 210 211 212 213
    padding: $cap-spacing--half $side-spacing $cap-spacing;
  }

  .esri-bookmarks__time-extent-group {
    display: grid;
    grid-template-rows: auto auto;
杨思琦's avatar
杨思琦 committed
214 215
    color: $interactive-font-color;
    font-size: $font-size--small;
216 217
  }

218
  .esri-bookmarks__add-bookmark {
杨思琦's avatar
杨思琦 committed
219 220 221
    display: flex;
    align-items: center;
    justify-content: center;
222
    background-color: $background-color--offset;
杨思琦's avatar
杨思琦 committed
223
    padding: $cap-spacing--half $side-spacing--half $cap-spacing;
224 225 226
  }

  .esri-bookmarks__add-bookmark-button {
杨思琦's avatar
杨思琦 committed
227 228 229
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
230
    transition: background-color 250ms ease-in-out;
杨思琦's avatar
杨思琦 committed
231 232 233 234 235 236
    border-radius: $button-height;
    background-color: $background-color;
    padding: $cap-spacing--three-quarters $side-spacing--half;
    width: auto;
    font-size: $font-size--small;

237 238
    &:hover {
      @include defaultBoxShadow();
杨思琦's avatar
杨思琦 committed
239 240

      text-decoration: none;
241 242 243 244
    }
  }

  .esri-bookmarks__add-bookmark-icon {
杨思琦's avatar
杨思琦 committed
245 246
    padding-inline-start: $side-spacing--quarter;
    padding-inline-end: $side-spacing--half;
247 248 249 250 251 252 253 254 255 256 257 258
    font-size: $font-size;
  }

  .esri-bookmarks__authoring-card {
    background-color: $background-color--offset;
    padding: $cap-spacing--half $side-spacing--half;
    animation: esri-fade-in-down 250ms ease-in-out;
  }

  .esri-bookmarks__authoring-card .esri-bookmarks__bookmark-image-container {
    border: 1px solid $border-color;
    background-image: url("../base/images/transparent-bg.png");
杨思琦's avatar
杨思琦 committed
259 260 261
    width: $bookmarks-thumbnail-size;
    height: $bookmarks-thumbnail-size;

262 263
    .esri-bookmarks__image {
      margin-top: 0;
杨思琦's avatar
杨思琦 committed
264
      margin-bottom: 0;
265 266 267 268
    }
  }

  .esri-bookmarks__authoring-form {
杨思琦's avatar
杨思琦 committed
269 270
    @include defaultBoxShadow();

271 272 273
    display: flex;
    flex-flow: column;
    border-radius: $border-radius;
杨思琦's avatar
杨思琦 committed
274
    background-color: $background-color;
275 276 277 278
  }

  .esri-bookmarks__authoring-container {
    display: flex;
279
    flex-flow: row;
杨思琦's avatar
杨思琦 committed
280
    align-items: center;
281
    padding: $cap-spacing $side-spacing;
杨思琦's avatar
杨思琦 committed
282

283 284 285
    .esri-bookmarks__authoring-label {
      padding-top: 0;
      padding-bottom: 0;
杨思琦's avatar
杨思琦 committed
286 287 288 289 290 291 292
      width: calc(100% - #{$bookmarks-thumbnail-size}); // Firefox fix
    }
  }

  .esri-bookmarks__authoring-form--adding {
    .esri-bookmarks__authoring-label {
      padding-inline: $side-spacing;
293
    }
294 295 296 297 298
  }

  .esri-bookmarks__authoring-label {
    display: flex;
    flex: 1 0 auto;
杨思琦's avatar
杨思琦 committed
299 300 301 302 303 304
    flex-flow: column;
    padding-block: $cap-spacing;
  }

  .esri-bookmarks__authoring-label--start-padding {
    padding-inline-start: $side-spacing;
305 306 307 308 309 310
  }

  .esri-bookmarks__authoring-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: $cap-spacing--half;
杨思琦's avatar
杨思琦 committed
311 312 313
    border-top: solid 1px $border-color;
    padding: $cap-spacing--half $side-spacing;

314 315
    .esri-button {
      width: 33%;
杨思琦's avatar
杨思琦 committed
316 317
      min-height: $button-height--half;
      font-size: $font-size--small;
318
    }
杨思琦's avatar
杨思琦 committed
319

320 321 322
    .esri-bookmarks__authoring-delete-button {
      margin-right: auto;
      padding-right: 0;
杨思琦's avatar
杨思琦 committed
323
      padding-left: 0;
324
      width: auto;
杨思琦's avatar
杨思琦 committed
325
      color: $font-color--error;
326 327 328 329
    }
  }

  .esri-widget__no-bookmark-icon {
杨思琦's avatar
杨思琦 committed
330
    display: inline-block;
331 332 333
    width: $button-height--double;
    height: $button-height--double;
    text-align: center;
杨思琦's avatar
杨思琦 committed
334 335
    line-height: $button-height--double;
    font-size: $button-height;
336 337 338 339
  }

  .esri-bookmarks--fade-in {
    transition: opacity 375ms ease-out;
杨思琦's avatar
杨思琦 committed
340
    opacity: 0;
341 342 343 344 345 346
  }

  .esri-bookmarks--fade-in-active {
    opacity: 1;
  }

347
  [dir="rtl"] .esri-bookmarks {
348
    .esri-bookmarks__bookmark {
杨思琦's avatar
杨思琦 committed
349
      &--active::after {
350 351 352
        animation: looping-progresss-bar-ani $looping-progress-bar-params reverse;
      }
    }
杨思琦's avatar
杨思琦 committed
353

354 355 356 357
    .esri-bookmarks__bookmark-container {
      margin-right: 0;
      margin-left: $side-spacing--half;
    }
杨思琦's avatar
杨思琦 committed
358

359 360 361 362
    .esri-bookmarks__authoring-actions .esri-bookmarks__authoring-delete-button {
      margin-right: 0;
      margin-left: auto;
    }
杨思琦's avatar
杨思琦 committed
363

364
    .esri-bookmarks__bookmark-button {
杨思琦's avatar
杨思琦 committed
365
      text-align: initial;
366
    }
杨思琦's avatar
杨思琦 committed
367

368 369 370 371 372 373 374
    .esri-bookmarks__bookmark-image-container .esri-button-menu {
      right: unset;
      left: 2px;
    }
  }
}

杨思琦's avatar
杨思琦 committed
375
@if $include_Bookmarks == true {
376 377
  @include bookmarks();
}