uccser/cs-field-guide

View on GitHub
csfieldguide/static/interactives/matrix-simplifier/scss/matrix-simplifier.scss

Summary

Maintainability
Test Coverage
@import "static/interactives/matrix-simplifier/node_modules/dragula/dist/dragula";
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";

.matrix-row input {
  display: inline-block;
  width: 20%;
  margin-bottom: 0.2rem;
  font-family: monospace;
}

.draggable {
  position: relative;
  &.gu-mirror {
    opacity: 1 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  }
}

.handle {
  touch-action: none;
  cursor: grab;
  &.held {
    cursor: grabbing;
  }
  &.cover {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    z-index: 3;
  }
}

.content {
  background-color: #fff;
  width: 70%;
  padding-left: 1.875rem;
  padding-right: 1.875rem;
}

.matrix, .vector {
  overflow-x: auto;
}

// make matrices wider and enlarge close and edit buttons
// for medium and smaller devices
@include media-breakpoint-down(md) {
  .content {
    background-color: #fff;
    width: 100%;
  }

  .dismiss-eqtn {
    font-size: 2.5rem !important;

    span {
      color: #7f7f7f;
    }
  }

  .edit-eqtn {
    top: 2.5rem !important;

    svg {
      height: 20pt;
      width: 20pt;
      fill: #7f7f7f;
    }
  }

  .move-eqtn {
    top: 0.25rem !important;

    svg {
      height: 20pt;
      width: 20pt;
      fill: #7f7f7f;
    }
  }
}

#output-container > div {
  display: flex;
  align-items: center;
  justify-content: center;

  .MathJax_Display {
    width: min-content;
  }
}

.close {
  color: #000;
}

.close:focus, .close:active {
  outline: none !important;
  box-shadow: none;
}

.move-eqtn {
  top: 0;
  left: 0.2rem;
  font-size: 1.8rem;
  position: absolute;
  z-index: 2;
}

.dismiss-eqtn {
  top: 0;
  right: 0.2rem;
  font-size: 1.8rem;
  position: absolute;
  z-index: 2;
}

.edit-eqtn {
  top: 1.5rem;
  right: 0.1rem;
  position: absolute;
  z-index: 2;
}

// Copy bootstrap helper class but add !important
.center-block {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}

.input-error {
  border: 0.0625rem solid red;
}

.input-error:focus {
  border-color: #FF0000;
  box-shadow: inset 0 0.0625rem 0.0625rem rgba(0, 0, 0, 0.075), 0 0 0.5rem rgba(255, 0, 0, 0.6);
}

.result-step {
  overflow-x: auto;
  white-space: nowrap;
  overflow-y: hidden;
}

.btn-container {
  width: 70%;
  margin: auto;
}