<div class="step_01">
<div class="step_01--item" aria-current="step"><span class="step_01--marker"></span>Step1</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step2</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step3</div>
</div>
<div class="step_01">
<div class="step_01--item"><span class="step_01--marker"></span>Step1</div>
<div class="step_01--item" aria-current="step"><span class="step_01--marker"></span>Step2</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step3</div>
</div>
<div class="step_01">
<div class="step_01--item"><span class="step_01--marker"></span>Step1</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step2</div>
<div class="step_01--item" aria-current="step"><span class="step_01--marker"></span>Step3</div>
</div>
<div class="step_01">
<div class="step_01--item"><span class="step_01--marker"></span>Step1</div>
<div class="step_01--item" aria-current="step"><span class="step_01--marker"></span>Step2</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step3</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step4</div>
</div>
<div class="step_01">
<div class="step_01--item"><span class="step_01--marker"></span>Step1</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step2</div>
<div class="step_01--item" aria-current="step"><span class="step_01--marker"></span>Step3</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step4</div>
<div class="step_01--item"><span class="step_01--marker"></span>Step5</div>
</div>
/* No context defined. */
// =====================================================================================
//
// step_01
//
// =====================================================================================
@use 'scss/global' as g;
// -------------------------------------------------------------------------------------
// 変数
// -------------------------------------------------------------------------------------
// 非アクティブ状態の色
$color_inactive: #ccc;
// アクティブ状態の色
$color_active: #000;
// -------------------------------------------------------------------------------------
// 全体枠
// -------------------------------------------------------------------------------------
.step_01 {
position: relative;
display: flex;
}
// -------------------------------------------------------------------------------------
// 全体枠 > ステップ単体
// -------------------------------------------------------------------------------------
.step_01--item {
position: relative;
flex-basis: 100%;
padding-top: 26px;
font-size: g.$font_size_s;
text-align: center;
&::before,
&::after {
position: absolute;
top: 10px;
display: block;
height: 4px;
margin: auto;
content: '';
background-color: $color_active;
}
&::before {
left: 0;
width: 100%;
}
&::after {
right: 50%;
width: 100%;
}
&:first-child::before {
left: 50%;
width: 100%;
}
&:last-child::before,
&:first-child::after {
width: 0;
}
&[aria-current='step'] ~ .step_01--item::after {
background-color: $color_inactive;
}
}
// -------------------------------------------------------------------------------------
// 全体枠 > ステップ単体 > アイコン
// -------------------------------------------------------------------------------------
// 継承専用:現在地マーク(円)
%step_01_current {
&::after {
position: absolute;
top: 6px;
left: 6px;
width: 12px;
height: 12px;
margin: 0;
content: '';
background: #fff;
border-radius: 50%;
}
}
// 継承専用:完了マーク(チェックマーク)
%step_01_done {
&::after {
position: absolute;
top: 50%;
left: 8px;
display: block;
width: 8px;
height: 13px;
margin-top: -8px;
content: '';
border-right: 3px solid #fff;
border-bottom: 3px solid #fff;
transform: rotate(45deg);
}
}
.step_01--marker {
position: absolute;
top: 0;
left: 50%;
z-index: 1;
display: block;
width: 24px;
height: 24px;
margin: 0 auto;
background-color: $color_active;
border-radius: 50%;
transform: translateX(-50%);
@extend %step_01_done;
.step_01--item[aria-current='step'] & {
@extend %step_01_current;
}
.step_01--item[aria-current='step'] ~ .step_01--item & {
background-color: $color_inactive;
&::after {
content: none;
}
}
}