<a class="button-49" href="#"><span class="button-49__text">ボタン49</span></a>
a.button-49(href=link)
  span.button-49__text #{ text }
{
  "link": "#",
  "text": "ボタン49"
}
  • Content:
    $BLOCK_NAME: '.button-49';
    
    // 変数
    $bg_offset: 30px;
    
    #{ $BLOCK_NAME } {
      position: relative;
      display: inline-block;
      padding: 16px;
      text-align: center;
      background: #000;
      border-radius: 9999px;
      color: #fff;
      min-width: 240px;
      overflow: hidden;
      &::before {
        top: 0;
        bottom: 0;
        left: -$bg_offset;
        right: 0;
        position: absolute;
        content: '';
        background: url(https://picsum.photos/id/29/400/200);
        background-size: cover;
        opacity: 0;
        transition: opacity 0.5s, transform 0.5s;
      }
      &:hover {
        color: #fff;
        &::before {
          opacity: 0.5;
          transform: translateX($bg_offset);
        }
      }
    
      &__text {
        position: relative;
        z-index: 1;
      }
    }
    
  • URL: /components/raw/button49/button49.scss
  • Filesystem Path: src/components/buttons/button49/button49.scss
  • Size: 708 Bytes