demo/src/styles/main.scss

Summary

Maintainability
Test Coverage
/* stylelint-disable no-descending-specificity */

@import '../../../packages/miew/src/Miew.scss';

//////////////////////////////////////////////////////////////////////////////
// Full-page web application
//////////////////////////////////////////////////////////////////////////////

html,
body {
  height: 100%;
  margin: 0;
  background-color: #202020;
}

//////////////////////////////////////////////////////////////////////////////
// ...
//////////////////////////////////////////////////////////////////////////////

$titlebar-color: silver;
$titlebar-gray: 64;
$titlebar-alpha: 0.75;
$titlebar-height: 40px;
$back-gray: 32;
$menu-gray: calc(
  #{$titlebar-alpha} * #{$titlebar-gray} + (1 - #{$titlebar-alpha}) * #{$back-gray}
);
$selection-panel-row-height: 42px;

.mode-message {
  top: calc(#{$titlebar-height} + 10px);
  width: 200px;
  height: 50px;
  color: $titlebar-color;
  background-color: rgba(
    $titlebar-gray,
    $titlebar-gray,
    $titlebar-gray,
    $titlebar-alpha
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;

  p {
    margin: 0;
    text-align: center;
  }
}

.miew-error {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  max-height: 25%;
  overflow: auto;
  border-top: 2px solid #aaa;
  background-color: #333;
  padding-top: 10px;
  font-weight: bold;

  p {
    color: yellow;
    margin: 0;
  }

  pre {
    margin: 0;
    border-radius: 0;
    border: 0;
    background-color: transparent;
    color: #f55;
  }
}

.atom-info {
  position: absolute;
  top: calc(#{$titlebar-height} + 10px);
  right: 10px;
  border-radius: 4px;
  color: $titlebar-color;
  background-color: rgba(
    $titlebar-gray,
    $titlebar-gray,
    $titlebar-gray,
    $titlebar-alpha
  );
  display: flex;
  justify-content: left;
  opacity: 0;

  p {
    margin: 10px;
    text-align: left;
  }
}

//////////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////////

.dg.ac {
  top: $titlebar-height !important;
}

.dg.a {
  margin-right: 0 !important;
}

.dg input {
  line-height: normal;
}

.blur {
  filter: blur(10px);
}

#miew-menu {
  .btn-titlebar,
  .btn-titlebar:hover,
  .btn-titlebar.hover,
  .btn-titlebar:focus,
  .btn-titlebar.active,
  .btn-titlebar.active:hover,
  .btn-titlebar.active.hover,
  .btn-titlebar.active:focus {
    background-color: transparent;
    color: $titlebar-color;
    border: none;
    border-radius: 0;
    width: $titlebar-height;
    height: $titlebar-height;
    outline-color: rgba(
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-alpha
    );
    // font-size: larger;
  }

  .btns-miew-titlebar-left {
    position: absolute;
    left: 0;
    top: 0;
  }

  .btns-miew-titlebar-right {
    position: absolute;
    right: 0;
    top: 0;
  }

  .titlebar {
    position: absolute;
    left: 0;
    top: 0;
    padding: calc((#{$titlebar-height} - 20px) / 2);
    width: 100%;
    height: $titlebar-height;
    text-align: center;
    color: $titlebar-color;
    background-color: rgba(
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-alpha
    );

    .tooltip-inner {
      color: #383838;
      background-color: #eee;
    }

    .tooltip-arrow {
      display: none;
    }
  }

  [data-toolbar-type='miew-menu-toolbar-mode'],
  [data-toolbar-type='miew-menu-toolbar-colorer'],
  [data-toolbar-type='miew-menu-toolbar-resolution'] {
    position: absolute;
    right: 0;
    top: $titlebar-height;
    width: 100%;
    height: calc(100% - #{$titlebar-height});
    background-color: transparent;
    overflow: auto;

    .pseudo-row {
      position: absolute;
      right: 0;
      display: flex;
      flex-wrap: wrap;
      flex-direction: column;
      justify-content: flex-start;
      padding: 0;
      margin: 0;
      max-width: 626px;
      background-color: #eee;

      .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 0;
        margin: 0;

        .thumbnail {
          background-color: #eee;
          color: #ccc;
          border: hidden;

          img {
            width: 96px;
            height: 96px;
          }

          .caption {
            padding: 0;
            margin-top: 5px;
          }
        }

        .thumbnail.active {
          .caption {
            color: #fff;
            background-color: #337ab7;
          }
        }

        h5 {
          color: #333;
          font-weight: 700;
          margin-left: 5px;
        }
      }
    }
  }

  /* Nav links */
  .blog-nav-item {
    position: relative;
    display: inline;
    padding: 10px;
    font-weight: 500;
  }

  .blog-nav .active::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -5px;
    vertical-align: middle;
    content: ' ';
    border-right: 5px solid transparent;
    border-bottom: 5px solid;
    border-left: 5px solid transparent;
    color: #eee;
  }

  .main-menu {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background-color: rgba(
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-gray,
      $titlebar-alpha
    );

    // full-height menus
    .row {
      height: 100%;
      max-width: 1024px;
      display: flex;
      flex-wrap: wrap;
      margin-left: 0;
      margin-right: auto;
      padding: 0;
    }

    .row::before,
    .row::after {
      display: none;
    }

    input[type='number']::-webkit-outer-spin-button,
    input[type='number']::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }

    input[type='number'] {
      -moz-appearance: textfield;
    }
  }

  .panel-menu {
    padding: 0;
    margin-bottom: 0;
    // border-color: #aaa;
    // border-radius: 0;

    border: none;
    background-color: #eee;
    height: 100%;

    .panel-heading {
      border-radius: 0;
      border: none;
      padding: 0;
      height: $titlebar-height;
      background-color: rgb($menu-gray, $menu-gray, $menu-gray);
      color: silver;

      .panel-title {
        padding: calc((#{$titlebar-height} - 17px) / 2);
        font-weight: bold;
        text-align: center;
      }
    }

    .panel-body {
      height: calc(100% - #{$titlebar-height});
      overflow: auto;

      .miew-repr-list-controls {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 20px;

        .btn {
          flex-grow: 2;
        }
      }

      [data-toggle='preset-pdb'] {
        padding-left: 5px;
        padding-right: 5px;
      }
    }

    .list-group {
      padding: 0;
    }

    [data-toggle='selectcolor'] {
      padding-left: 5px;
      padding-right: 5px;
    }

    [data-toggle='selectcolor'].active {
      a {
        border-width: 2px;
        border-color: #337ab7;
      }
    }
  }

  .panel-dark {
    background-color: rgb($menu-gray, $menu-gray, $menu-gray);

    .list-group {
      border: none;

      .list-group-item {
        background-color: rgb($menu-gray, $menu-gray, $menu-gray);
        color: silver;
        border: none;
      }

      .list-group-item.active {
        background-color: #eee;
        color: rgb($menu-gray, $menu-gray, $menu-gray);
      }
    }
  }

  .miew-menu-panel-tooltips > .tooltip > .tooltip-inner {
    color: rgb($menu-gray, $menu-gray, $menu-gray);
    background-color: transparent;
  }

  .miew-menu-panel-tooltips > .tooltip > .tooltip-arrow {
    display: none;
  }

  .panel-menu[data-panel-type='miew-menu-panel-select-color'] .row {
    align-content: flex-start;
  }

  .panel-menu[data-panel-type='miew-menu-panel-selection'] {
    .row {
      display: flex;
      margin: 0;
      height: calc(7 * #{$selection-panel-row-height});

      .column {
        padding: 0 2px;

        .nav-tabs li a {
          padding-right: 7px;
          padding-left: 7px;
          margin: 0;
          height: $selection-panel-row-height;
        }

        .list-group {
          height: calc(7 * #{$selection-panel-row-height});
          overflow: auto;

          .list-group-item {
            height: $selection-panel-row-height;
          }
        }
      }

      .calc {
        margin-top: $selection-panel-row-height;

        .btn-calc {
          height: $selection-panel-row-height;
          padding-left: 3px;
          padding-right: 3px;
          text-align: center;
          vertical-align: middle;
          background: linear-gradient(to top, #eee, #f9f9f9);
        }

        .btn-calc.digit {
          background: linear-gradient(to top, #f1f1f1, #fff);
        }

        .btn-calc.char {
          background: linear-gradient(to top, #f1f1f1, #fff);
        }
      }
    }
  }

  [data-modal-type='miew-menu-modal-rename-preset'] {
    input[type='text'] {
      border-width: 0;
      width: 100%;
    }

    input[type='text']:focus {
      outline: none;
      border-width: 0;
    }
  }

  .miew-menu-btns-preset-edit .btn {
    margin-left: 4px;
    border: none;
    color: #337ab7;
  }

  .miew-repr-list {
    .panel-heading {
      background-color: #fff;
      color: #333;
      height: $titlebar-height;

      .panel-title {
        text-align: left;
        display: flex;
        flex-wrap: nowrap;

        a {
          white-space: pre-wrap;
          overflow: hidden;
          max-height: 20px;
        }

        .pseudo-div {
          flex-grow: 5;
          margin-left: 5px;

          .badge {
            background-color: #333;
            color: #fff;
          }
        }
      }

      .btn {
        padding: 0;
        margin-right: 10px;
        height: 20px;
        width: 20px;
        border: 0;
      }
    }

    .panel-heading.active {
      background-color: #337ab7;
      color: #fff;

      .pseudo-div .badge {
        background-color: #fff;
        color: #337ab7;
      }

      .btn {
        background-color: #337ab7;
        color: #fff;
      }
    }

    .spinner-inc-btn,
    .spinner-dec-btn {
      width: auto;
      height: auto;
      padding: 1px 2px;
    }

    input[type='number'] {
      width: 32px;
      height: auto;
      padding: 1px 2px;
      text-align: center;
    }

    .list-group-item {
      border-width: 1px;
      max-height: $titlebar-height;

      .thumbnail {
        width: calc(#{$selection-panel-row-height} / 2);
        height: calc(#{$selection-panel-row-height} / 2);
        margin: 0;
        padding: 0;
      }
    }

    [data-value='miew-menu-panel-select-color'] {
      span.pull-right {
        display: flex;
      }
    }

    [data-value='miew-menu-panel-selection'] {
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;

      span.pull-right {
        margin-left: 15px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;

        [data-type='selection-target'] {
          text-align: right;
          white-space: pre-wrap;
          overflow: hidden;
          max-height: 20px;
        }
      }
    }
  }

  [data-form-type='miew-menu-form-load-pdb'] {
    overflow: hidden;

    input[type='file'] {
      position: absolute;
      top: 0;
      right: 0;
      min-width: 100%;
      min-height: 100%;
      font-size: 100px;
      text-align: right;
      filter: alpha(opacity=0);
      opacity: 0;
      outline: none;
      background: white;
      cursor: inherit;
      display: block;
    }
  }

  .list-group-item label {
    font-weight: normal;
    margin-bottom: 0;
  }

  .checkbox-background {
    .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary {
      color: #eee;
      background-color: #383838;
    }

    .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
      color: #383838;
      background-color: #eee;
    }
  }

  .modal-body {
    overflow: auto;
  }
}

.miew-terminal {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 30%;
  padding: 0;
  margin-top: $titlebar-height;

  --background: transparent;

  .row {
    margin-left: 0;
    margin-right: 0;
  }
}

.miew-terminal-body {
  display: block;
  height: 100%;
  border: 1px solid #444;
  background: rgba(0, 0, 0, 0.75);
}

.miew-configured-pdb-list-action,
.miew-configured-pdb-list-item-action {
  color: #337ab7;
  cursor: pointer;
}

.miew-configured-pdb-list-item-action {
  margin-left: 10px;
}

.active .miew-configured-pdb-list-item-action {
  color: white;
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rotating {
  animation: rotating 2s linear infinite;
}

.toast-error {
  background-color: #b22746;
}

.toast-warning {
  background-color: #f8aa02;
}

.toast-info {
  background-color: #39c2d7;
}

.toast-top-right {
  top: calc(#{$titlebar-height} + 6px);
  right: 6px;
}

#toast-container > div {
  opacity: 0.9;
  box-shadow: none;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  font-weight: bold;
}

.toolbar-thumb {
  width: 96px;
  height: 96px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.75);
}