Skip to content
Snippets Groups Projects
accordion-item.scss 2.02 KiB
Newer Older
  • Learn to ignore specific revisions
  • Tuukka Turu's avatar
    Tuukka Turu committed
    :host {
      display: block;
    }
    
    .hy-accordion__item {
      margin-bottom: 1rem;
    
      &__is-open {
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        border-bottom: 2px solid var(--grayscale-medium);
        border-left: 1px solid var(--grayscale-medium);
        border-right: 1px solid var(--grayscale-medium);
        border-top: 2px solid var(--grayscale-medium);
        box-shadow: 0px 2px 12px 1px rgba(#000000, 10%);
    
    Tuukka Turu's avatar
    Tuukka Turu committed
    
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        .hy-accordion--heading {
          margin: 0 auto;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
    
    
    Tuukka Turu's avatar
    Tuukka Turu committed
          .hy-accordion--heading__icon {
            transform: rotateX(180deg);
          }
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      }
    }
    
    .hy-accordion--heading {
      justify-content: flex-start;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      letter-spacing: -0.69px;
      line-height: 28px;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      margin: 0 auto;
    
      transition: all 0.25s ease-in-out;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      width: 100%;
    
      .hy-accordion__link {
        text-decoration: none;
    
        &:hover {
          text-decoration: none;
        }
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      .hy-accordion__button {
    
        @include font-size(22px, 28px);
    
        align-items: center;
        border: none;
    
        background-color: var(--grayscale-background-box);
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        color: var(--brand-main-nearly-black);
    
        display: flex;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        flex-direction: row;
        font-family: var(--main-font-family);
    
        font-weight: bold;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        height: 100%;
        justify-content: flex-start;
    
        letter-spacing: -0.7px;
        padding: 1.125rem 1rem 1.125rem 1rem;
    
        transition: all 0.35s ease-in;
    
        width: 100%;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
    
    
        @include breakpoint($narrow) {
          @include font-size(26px, 32px);
          letter-spacing: -0.8px;
          padding: 1rem 2rem 1rem 1.25rem;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        }
    
        &[aria-expanded='true'] {
    
    Tuukka Turu's avatar
    Tuukka Turu committed
          background: none;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        }
      }
    
      .hy-accordion--heading__icon {
    
        margin-right: 0.5rem;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        z-index: 0;
    
        @include breakpoint($narrow) {
          margin-right: 1rem;
        }
    
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        svg {
          fill: var(--brand-main);
    
    
          @include breakpoint($narrow) {
            height: 24px;
            width: 24px;
          }
    
    Tuukka Turu's avatar
    Tuukka Turu committed
        }
      }
    }
    
    .hy-accordion__content {
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      display: block;
      height: 0;
      overflow: hidden;
    
      padding: 0;
    
      transition: all 0.25s ease-in-out;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
    
      &--inner-wrapper {
        display: block;
    
    Tuukka Turu's avatar
    Tuukka Turu committed
      }
    
    
      hy-box {
        @include breakpoint($narrow) {
          padding: 0 2rem;
        }
      }