• 読み込み中アイコン
<span class="spinner_01 spinner_01-s"></span>
<span class="spinner_01"></span>
<span class="spinner_01 spinner_01-l"></span>
/* No context defined. */
  • Content:
    // =====================================================================================
    //
    // spinner_01
    //
    // =====================================================================================
    
    @use 'sass:map';
    @use 'scss/global' as g;
    
    // -------------------------------------------------------------------------------------
    // 変数
    // -------------------------------------------------------------------------------------
    
    // 背景色
    $bg_color: transparent;
    
    // 前景色
    $fg_color: #000;
    
    // Modify無しの標準サイズ
    $m: (
      'size': 40px,
      'border_width': 3px,
    );
    
    // サイズ:小
    $s: (
      'size': 20px,
      'border_width': 2px,
    );
    
    // サイズ:大
    $l: (
      'size': 60px,
      'border_width': 4px,
    );
    
    // アイコンが1回転するまでの時間
    $duration: 0.5s;
    
    // -------------------------------------------------------------------------------------
    // アニメーション
    // -------------------------------------------------------------------------------------
    @keyframes spinner_01_anim {
      from {
        transform: rotate(0deg);
      }
    
      to {
        transform: rotate(360deg);
      }
    }
    
    // -------------------------------------------------------------------------------------
    // 基本スタイル
    // -------------------------------------------------------------------------------------
    .spinner_01 {
      display: inline-block;
      width: map.get($m, 'size');
      height: map.get($m, 'size');
      border-top: map.get($m, 'border_width') solid $bg_color;
      border-right: map.get($m, 'border_width') solid $fg_color;
      border-bottom: map.get($m, 'border_width') solid $fg_color;
      border-left: map.get($m, 'border_width') solid $fg_color;
      border-radius: 50%;
      animation: spinner_01_anim $duration infinite linear;
    
      &::after {
        width: map.get($m, 'size');
        height: map.get($m, 'size');
        border-radius: 50%;
      }
    }
    
    // -------------------------------------------------------------------------------------
    // Modify
    // -------------------------------------------------------------------------------------
    
    // サイズ:小
    .spinner_01-s {
      width: map.get($s, 'size');
      height: map.get($s, 'size');
      border-width: map.get($s, 'border_width');
    
      &::after {
        width: map.get($s, 'size');
        height: map.get($s, 'size');
      }
    }
    
    // サイズ:大
    .spinner_01-l {
      width: map.get($l, 'size');
      height: map.get($l, 'size');
      border-width: map.get($l, 'border_width');
    
      &::after {
        width: map.get($l, 'size');
        height: map.get($l, 'size');
      }
    }
    
  • URL: /components/raw/spinner_01/_spinner_01.scss
  • Filesystem Path: src/assets/_parts/components/spinner/spinner_01/_spinner_01.scss
  • Size: 2.5 KB