ernestwisniewski/kbin

View on GitHub
assets/styles/components/_magazine.scss

Summary

Maintainability
Test Coverage
.magazine {
  .panel {
    margin-bottom: 1rem;
    text-align: center;

    a, button {
      display: block;
      width: 100%;
    }
  }

  header {
    h4, h4 a {
      font-size: 1.2rem;
      margin-bottom: 0;
      margin-top: .5rem;
    }

    text-align: center;
  }

  figure {
    text-align: center;
  }

  &__name {
    margin-top: 0;
  }

  &__description,
  &__rules {
    ul {
      padding-left: .5rem;

      li {
        list-style: none;
        margin-bottom: .5rem;
      }
    }

    ol {
      padding-left: 0.5rem;

      li {
        list-style: circle;
        margin-left: 2px;
        margin-bottom: 0.5rem;
      }
    }
  }

  &__subscribe {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;

    div {
      align-items: center;
      background: var(--kbin-button-secondary-bg);
      border: var(--kbin-button-secondary-border);
      color: var(--kbin-button-secondary-text-color);
      display: flex;
      flex-direction: row;
      font-size: .9rem;
      left: 1px;
      padding: .3rem .5rem;
      position: relative;

      .rounded-edges & {
        border-radius: .5rem;
      }
    }

    .action {
      span {
        margin-left: 0.5rem;
      }
    }

    button {
      height: 100%;
      padding-bottom: .5rem;
      padding-top: .5rem;
    }

    form:last-of-type {
      position: relative;
      right: 1px;
    }
  }
}

.magazine-inline {
  img {
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.25rem;

    @include media-breakpoint-down(sm) {
      width: 25px;
      height: 25px;
    }
  }
}

.magazines-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);

  @include media-breakpoint-down(sm) {
    grid-template-columns: repeat(1, 1fr);
  }

  .magazine {
    align-content: start;
    align-items: center;
    display: grid;
    grid-template-rows: auto;
  }

  h3 {
    border-bottom: var(--kbin-sidebar-header-border);
    color: var(--kbin-sidebar-header-text-color);
    font-size: .8rem;
    margin: 0 0 1rem;
    text-transform: uppercase;
  }

  .content {
    font-size: 0.85rem;
  }
}

.magazines-columns,
.domains-columns {
  font-size: .9rem;

  ul {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 0;

    @include media-breakpoint-down(lg) {
      grid-template-columns: repeat(2, 1fr);
    }

    @include media-breakpoint-down(sm) {
      grid-template-columns: repeat(1, 1fr);
    }
  }

  ul figure {
    margin: 0 .5rem 0 0;
  }

  ul li {
    align-items: center;
    display: flex;
    list-style: none;
    position: relative;
  }

  ul li a {
    display: block
  }

  ul li small {
    color: var(--kbin-meta-text-color);
    font-size: .85rem;
  }
}

td {
  .magazine__subscribe {
    margin: 0;
  }
}

.page-magazine-panel {
  .container {
    margin: 0 auto;
    max-width: 30rem;
  }

  .report {
    div {
      margin-bottom: .5rem;
    }
  }

  .actions {
    margin-bottom: 0 !important;

    @include media-breakpoint-down(sm) {
      display: flex;
      flex-wrap: wrap;
    }
  }

  .users-columns,
  .columns {
    .actions {
      margin-left: 1rem;

      .btn {
        padding: .5rem;
      }
    }
  }
}

.related-magazines {
  h3 {
    margin: 0 0 .5rem !important;
  }

  ul.meta li:first-child {
    border-top: 0 !important;
    margin-top: 0 !important;
  }
}

.magazines.table-responsive {
  display: none;

  @include media-breakpoint-up(md) {
    display: block;
  }

}

.magazine-list-mobile {
  display: none;

  .magazines__sortby {
    display: flex;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;

    span {
      display: flex;
    }
  }

  .magazine {
    position: relative;
    border-bottom: var(--kbin-section-border);
    padding: 1rem;
    font-size: 0.9rem;

    &:nth-of-type(even) {
      background-color: var(--kbin-bg-nth);
    }

    &__top {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      column-gap: 1rem;
      row-gap: 0.5rem;
      flex-wrap: wrap;
    }

    &__inline {
      width: 100%;
      position: relative;
    }

    &__sub {

    }

    &__information {
      justify-content: space-evenly;
      display: flex;
      column-gap: 1rem;
      width: 100%;

      > span {
        border-left: var(--kbin-section-border);
        padding-left: 1rem;
        margin-right: auto;

        &:first-child {
          padding-left: 0px;
          border: 0px;
        }
      }

    }

    &__info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      .value {
        font-weight: bold;
      }
    }

    span {
      position: relative;
    }

    &__subscribe {
      margin-bottom: 0px;
    }
  }

  @include media-breakpoint-up(md) {
    border: solid 1px red;
  }

  @include media-breakpoint-down(md) {
    display: block;
  }
}

.page-categories,
.page-settings-categories {
  td {
    white-space: nowrap;
  }
}