Skip to content
Snippets Groups Projects
hy-checkbox.scss 1.37 KiB
Newer Older
  • Learn to ignore specific revisions
  • .hy-checkbox {
      display: inline-block;
      position: relative;
    
      margin-right: 1rem;
    
    }
    
    .hy-checkbox__checkmark {
      border-color: var(--link-blue);
      border-style: solid inset solid solid;
      border-width: 2px;
      height: 20px;
      margin-right: 6px;
      position: relative;
      width: 20px;
    
      svg {
        bottom: 0;
        left: 0;
        position: absolute;
        visibility: hidden;
      }
    
      &::before {
        background-color: var(--grayscale-white);
        content: '';
        height: 10px;
        position: absolute;
        right: 0;
        transform: rotate(40deg) translate(6%, -55%);
        visibility: hidden;
        width: 8px;
      }
    }
    
    .hy-checkbox__label {
      @include font-size(14px, 20px);
      align-items: center;
      color: var(--grayscale-black);
      display: inline-flex;
      font-family: var(--main-font-family);
      letter-spacing: -0.4px;
    
      @include breakpoint($narrow) {
        @include font-size(16px, 24px);
      }
    }
    
    .hy-checkbox__checkbox {
      height: 100%;
      margin: 0;
      opacity: 0;
      position: absolute;
      width: 100%;
      z-index: 10;
    
      &:checked {
        & + label {
          color: var(--grayscale-black);
    
          .hy-checkbox__checkmark {
            svg,
            &::before {
              visibility: visible;
            }
          }
        }
      }
    
      &:hover {
        cursor: pointer;
    
        & + label {
          color: var(--brand-main);
        }
      }
    
      &:focus {
        & + label {
          outline-offset: 1px;
          outline: 2px solid var(--link-blue);
        }
      }
    }