nukeop/nuclear

View on GitHub
packages/ui/lib/components/Card/styles.scss

Summary

Maintainability
Test Coverage
@import "../../common";

.card_container {
  width: 100%;
  max-width: 240px;
  padding: 1rem;

  .card {
    @include roundCorners;
    position: relative;
    display: flex;
    flex-flow: column;

    box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);
    background-color: $background2;
    transition: $short-duration ease-in-out;
    cursor: pointer;

    &.animated:hover {
      box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);
      transform: scale(1.1);
      
      .overlay {
        opacity: 1;
      }
    }

    .overlay {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      height: 100%;
      width: 100%;
      opacity: 0;
      transition: .5s ease;
      background-color: rgba(0, 0, 0, 0.4);
    }

    .thumbnail {
      @include roundCorners;
      position: relative;
      height: 0;
      padding-top: 100%;
      background-size: cover !important;
      background-position: center !important;
    }

    .card_content {
      padding: 1em;
      height: auto;

      h4 {
        @include ellipsis;
      }

      p {
        @include ellipsis;
        color: rgba($white, 0.6);
      }
    }
    .menu_button {
      position: absolute;
      z-index: 10;
      margin: 1em;
      align-self: flex-end;
    }
  }
}