<a class="button-02" href="#"><span class="button-02__text">ボタン02</span></a>
a.button-02(href=link)
span.button-02__text #{ text }
{
"link": "#",
"text": "ボタン02"
}
$BLOCK_NAME: '.button-02';
// 変数
$color-primary: #ffff00;
$color-border: #000;
$transition-bg: 0.5s;
#{ $BLOCK_NAME } {
position: relative;
display: flex;
align-items: center;
height: 55px;
padding: 0 20px;
font-weight: bold;
&::before,
&::after {
position: absolute;
right: 0;
left: 0;
display: block;
content: '';
}
&::before {
top: 0;
bottom: 0;
z-index: 1;
background: $color-primary;
transition: transform $transition-bg;
transform: scaleX(0);
transform-origin: top right;
}
&::after {
bottom: 0;
height: 2px;
background: $color-border;
}
&:hover {
&::before {
transform: scaleX(1);
transform-origin: top left;
}
}
&__text {
position: relative;
z-index: 2;
width: 100%;
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 30px;
height: 1px;
margin: auto 0;
content: '';
background: $color-border;
}
}
}