_grouped.scss 8.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/** @TODO: use JS Toolkit to create individual SASS files for
***        existing PS components
**/
@use "sass:math" as math;


/// FormInput
///-----------------------------------------------------------------------------

.b-form-input {

  &[type=password] {
    letter-spacing: space-x(1);
    font-weight: 700;
  }
}

/// Modal
///-----------------------------------------------------------------------------

.b-modal {
  $self: &;
  $wrapper-margin: 1.75rem; // from "_modal.scss"

  &__content {
    background-color: $modal-content-bg;
27 28
    margin-left: $wrapper-margin;
    margin-right: $wrapper-margin;
29 30 31 32 33
  }

  &__header {
    background-color: $card-cap-bg;

34
    &__title {
35 36 37 38 39
      color: $primary;
      font-size: 21px;
    }
  }

40 41 42 43
  // @XXX Bootstrap not removing some modal elements on "hide" method
  //      Adding an overlay that the user could click to synchronise the hide
  //      cinematic
  // @https://stackoverflow.com/questions/50168312/bootstrap-4-close-modal-backdrop-doesnt-disappear
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  &__overlay {
    width: 100%;
    height: 100%;
    position: absolute;
  }
}

/// Spinner
///-----------------------------------------------------------------------------

.b-spinner {
  // regarding sizing, Bootstrap set a default `2rem ^ 2rem`
  // (cf. "_spinners.scss")
  font-size: inherit;
}


/// Button
///-----------------------------------------------------------------------------


.b-button {
  $spinner-size: 20px;
  $self: &;

  @include clickable();

  position: relative;

  // (!) `translate` CSS modifiers won't work with bootstrap spinner
  &__spinner {
    position: absolute;
    left: calc(50% - #{ math.div($spinner-size, 2) });
    top: calc(50% - #{ math.div($spinner-size, 2) });
    width: $spinner-size;
    height: $spinner-size;
  }

  &--disabled,
  &--deferred,
  &--idled {
    @include unclickable();
  }

  &--deferred {

    #{ $self }__inner {
      visibility: hidden;
    }
  }

  // icon alignement
  .b-icon::before {
    line-height: $btn-line-height;
  }
}

arturo's avatar
arturo committed
101 102 103 104 105
/// Icon Button
///-----------------------------------------------------------------------------

.b-icon-button {
  $self: &;
arturo's avatar
arturo committed
106 107
  $overlay-offset-y: -6px;
  $overlay-offset-x: -10px;
arturo's avatar
arturo committed
108 109 110 111 112

  transition: color 0.2s;
  position: relative;
  transition: color 150ms ease-in-out;

arturo's avatar
arturo committed
113 114 115 116 117
  &__inner {
    // (due to overlay via pseudo element)
    z-index: 1;
    position: relative;
  }
arturo's avatar
arturo committed
118

arturo's avatar
arturo committed
119 120 121 122 123 124 125 126 127 128 129 130
  // overlay preparation
  &::before {
    left: $overlay-offset-x;
    right: $overlay-offset-x;
    top: $overlay-offset-y;
    bottom: $overlay-offset-y;
    border-radius: $overlay-radius;
    position: absolute;
    transition:
      background-color 150ms ease-in-out,
      box-shadow 150ms ease-in-out;
  }
arturo's avatar
arturo committed
131

arturo's avatar
arturo committed
132 133 134
  &--overlay::before {
    content: "";
  }
arturo's avatar
arturo committed
135

arturo's avatar
arturo committed
136 137 138 139
  // elevation levels
  &--level-1:hover::before {
    background-color: $gray-100;
  }
arturo's avatar
arturo committed
140

arturo's avatar
arturo committed
141 142 143 144 145
  &--level-2::before {
    background-color: $gray-100;
  }
  &--level-2:hover::before {
    background-color: darken($gray-100, 10%);
arturo's avatar
arturo committed
146 147
  }

arturo's avatar
arturo committed
148
  // component status UI changes
arturo's avatar
arturo committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
  &--enabled,
  &--muted,
  &--idled {
    @include clickable;

    &#{ $self }--warning    { color: $warning; }
    &#{ $self }--success    { color: $success; }
    &#{ $self }--danger     { color: $danger; }
    &#{ $self }--info       { color: $info; }
    &#{ $self }--primary    { color: $primary; }
    &#{ $self }--secondary  { color: $secondary; }
    &#{ $self }--dark       { color: $body-color; }
  }

  &--enabled,
  &--muted {
    &#{ $self }--warning:hover    { color: darken($warning, 10%); }
    &#{ $self }--success:hover    { color: darken($success, 10%); }
    &#{ $self }--danger:hover     { color: darken($danger, 10%); }
    &#{ $self }--info:hover       { color: darken($info, 10%); }
    &#{ $self }--primary:hover    { color: darken($primary, 10%); }
    &#{ $self }--secondary:hover  { color: darken($secondary, 10%); }
    &#{ $self }--dark:hover       { color: darken($body-color, 10%); }
arturo's avatar
arturo committed
172 173 174 175 176 177 178 179 180

    // active effect
    &#{ $self }:active,
    &#{ $self }--active {

      &::before {
        box-shadow: 0 0 0 0.2rem mix-alpha($gray-200, 50%);
      }
    }
arturo's avatar
arturo committed
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
  }

  &--idled:hover {
    @include unclickable();
  }

  &--disabled,
  &--deferred {
    @include unclickable();

    &#{ $self }--warning    { color: lighten($warning, 15%); }
    &#{ $self }--success    { color: lighten($success, 15%); }
    &#{ $self }--danger     { color: lighten($danger, 15%); }
    &#{ $self }--info       { color: lighten($info, 15%); }
    &#{ $self }--primary    { color: lighten($primary, 15%); }
    &#{ $self }--secondary  { color: lighten($secondary, 15%); }
    &#{ $self }--dark       { color: lighten($body-color, 15%); }
  }
}
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242

/// Fieldset
///-----------------------------------------------------------------------------

.b-fieldset {
  $margin: space-x(2);

  position: relative;
  border: $card-border-width solid $card-border-color;
  border-radius: $card-border-radius;
  padding-left: $margin;
  padding-right: $margin;
  padding-bottom: $margin;
  padding-top: calc( #{ $margin } + #{ $headings-margin-bottom } );
  background-color: inherit;

  &__legend {
    position: absolute;
    top: 0;
    font-size: $headings-font-family;
    font-weight: $headings-font-weight;
    color: $gray-600;
    line-height: $headings-line-height;
    margin: #{ - $headings-margin-bottom } 0 0;
    padding-left: $margin / 2;
    padding-right: $margin / 2;
    background-color: inherit;
  }
}

/// PhyloExplorer.ConfigForm
///-----------------------------------------------------------------------------

.phylo-config-form {


  &__row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
  }

  &__group {
arturo's avatar
arturo committed
243
    margin-bottom: $form-group-margin-bottom;
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
  }

  .b-fieldset {
    margin-left: $card-spacer-x;
    margin-right: $card-spacer-x;
  }

  &__col {
    width: 50%;

    &:first-child {
      padding-right: space-x(1);
    }

    &:last-child {
      padding-left: space-x(1);
    }
  }

  &__submit {
    text-align: center;
  }
}
arturo's avatar
arturo committed
267 268 269 270 271 272 273 274 275 276 277 278 279

/// Tabs
///-----------------------------------------------------------------------------

.b-tabs {

  .nav-item:first-child {
    margin-left: space-x(2);
  }
  .nav-item:last-child {
    margin-right: space-x(2);
  }
}
arturo's avatar
arturo committed
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314

/// Ripple
///-----------------------------------------------------------------------------

.b-ripple {
  @include fit-positions;

  position: absolute;
  overflow: hidden;

  &:after {
    @include fit-positions;

    content: "";
    position: absolute;
    pointer-events: none;
    background-image:
      radial-gradient(
        circle,
        #000 10%,
        transparent 10%
      );
    background-repeat: no-repeat;
    background-position: 50%;
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
    transform: scale(10);
  }

  &:active:after {
    transform: scale(0);
    opacity: 0.2;
    transition: transform 0s, opacity 0s;
  }

arturo's avatar
arturo committed
315
  @each $name, $value in $palette-semantic {
arturo's avatar
arturo committed
316 317 318 319 320 321 322 323 324 325

    &--#{ $name }:after {
      background-image:
        radial-gradient(
          circle,
          #{ $value } 10%,
          transparent 10%
        );
    }
  }
arturo's avatar
arturo committed
326 327 328 329 330 331

  &--disabled:after,
  &--deferred:after,
  &--muted:after {
    content: none;
  }
arturo's avatar
arturo committed
332
}
arturo's avatar
arturo committed
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354

/// Preloader
///-----------------------------------------------------------------------------

.b-preloader {
  width: 100%;
  height: 100%;

  &__spinner {
    $size: 100px;
    $weight: 6px;

    position: absolute;
    font-size: $weight;
    height: $size;
    width: $size;
    // (?) `centered` mixin will not work here, due to Bootstrap process
    //     interfering with the transform rule
    top: calc( 50% - #{ $size / 2 } );
    left: calc( 50% - #{ $size / 2 } );
  }
}
arturo's avatar
arturo committed
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419


/// Context Menu
///-----------------------------------------------------------------------------

.b-context-menu {
  $minimum-width: 280px;

  @include fit-positions();

  position: fixed;
  z-index: z-index('main', 'floaty');
  background-color: transparent;

  &__inner {
    position: fixed;
    box-shadow: $box-shadow-lg;
    border: 1px solid $gray-100;
    word-wrap: break-word;
    background-color: $body-bg;
    border-radius: $card-border-radius;
    min-width: $minimum-width;
  }
}

.b-context-menu-item {
  @include clickable();

  position: relative;
  background-color: $body-bg;
  padding: $list-group-item-padding-y $list-group-item-padding-x;
  font-size: 15px;

  &--disabled,
  &--deferred,
  &--idled {
    @include unclickable();

    color: $list-group-disabled-color;
  }

  &--enabled:hover,
  &--muted:hover {
    background-color: $list-group-hover-bg;
  }
}


/// Button Group
///-----------------------------------------------------------------------------

.b-button-group {
  $gutter: 2px;

  &--no-collapse {

    .btn:not(:first-child) {
      margin-left: calc( #{ $gutter } / 2 );
    }

    .btn:not(:last-child) {
      margin-right: calc( #{ $gutter } / 2 );
    }
  }
}