// =====================================================================================
//
// btn_03
// - 同種のコンポーネントを併用する場合は、取り込むか、新しいRootsにするなどしてください
//
// =====================================================================================
@use 'scss/global' as g;
// -------------------------------------------------------------------------------------
// 変数
// -------------------------------------------------------------------------------------
// ホバー時アニメーションの継続時間
$hover_duration: 0.3s;
// ホバー時アニメーションのイージング
$hover_easing: g.$ease_out_cubic;
// 進む/戻るのアイコン色 ※Hexのみ。rgba()などは非対応
$color_icon: #999;
// -------------------------------------------------------------------------------------
// 基本
// -------------------------------------------------------------------------------------
.btn_03 {
position: relative;
display: inline-block;
width: 100%;
max-width: 240px;
padding: 24px 32px;
font-size: g.$font_size_base;
line-height: 1;
color: #000 !important; // a:linkが有効なため
text-align: center;
vertical-align: baseline;
cursor: pointer;
background: linear-gradient(135deg, #000 50%, #fff 50%);
background-position: right bottom;
background-size: 260% 100%;
border: 1px solid #000;
@include g.mq(pc) {
transition: color $hover_duration $hover_easing,
background-position $hover_duration $hover_easing;
&:hover {
color: #fff !important;
background-position: left bottom;
}
}
}
// -------------------------------------------------------------------------------------
// CTA、決定、進むなどポジティブなボタン
// -------------------------------------------------------------------------------------
.btn_03-primary {
color: #fff !important; // a:linkが有効なため
background: linear-gradient(135deg, #fff 50%, #000 50%);
background-position: right bottom;
background-size: 260% 100%;
@include g.mq(pc) {
&:hover {
color: #000 !important;
}
}
}
// -------------------------------------------------------------------------------------
// 進む(右向き矢印アイコン)
// -------------------------------------------------------------------------------------
.btn_03-forward {
text-indent: -11px;
&::after {
position: absolute;
top: 50%;
right: 16px;
width: 12px;
height: 12px;
content: '';
background-image: url('data:image/svg+xml;charset=UTF-8,');
background-repeat: no-repeat;
background-size: 12px 12px;
transform: translateY(-50%);
}
}
// -------------------------------------------------------------------------------------
// 戻る(左向き矢印アイコン)
// -------------------------------------------------------------------------------------
.btn_03-back {
text-indent: 11px;
&::after {
position: absolute;
top: 50%;
left: 16px;
width: 12px;
height: 12px;
content: '';
background-image: url('data:image/svg+xml;charset=UTF-8,');
background-repeat: no-repeat;
background-size: 12px 12px;
transform: translateY(-50%);
}
}
// -------------------------------------------------------------------------------------
// 幅を中身に合わせて可変
// -------------------------------------------------------------------------------------
.btn_03-auto {
width: auto;
max-width: none;
}
// -------------------------------------------------------------------------------------
// 幅を100%のブロックに
// -------------------------------------------------------------------------------------
.btn_03-block {
display: block;
max-width: none;
}
// -------------------------------------------------------------------------------------
// サイズ小
// -------------------------------------------------------------------------------------
.btn_03-s {
max-width: 160px;
padding: 16px 24px;
font-size: g.$font_size_s;
}