//base @mixin cover($top: 0, $left: 0, $width: 100%, $height: 100%) { position: absolute; top: $top; left: $left; width: $width; height: $height; }
条纹背景
&::before { @include inset(var(--stripe-inset)); content: ""; z-index: -1; background: repeating-linear-gradient( var(--stripe-deg), var(--stripe-color-1) 0 var(--stripe-offset-1), var(--stripe-color-2) 0 var(--stripe-offset-2) ); border-radius: var(--stripe-radius); } }
光泽效果
.btn { &-primary { border: 4px solid var(--gold-color-1);
span {
background-image: var(--gold-grad-2);
}
}
&-info { color: var(--brown-color-1); border: none; }
&-depth { box-shadow: 0 -5px 0 var(--brown-color-2); } }
缎带形状
position: relative; padding: 0.5rem 1rem; color: white; background: var(--ribbon-color-1);
.block { &:nth-child(1), &:nth-child(2) { position: absolute; bottom: -20%; width: 20%; height: 20%; background: var(--ribbon-color-2); clip-path: polygon(0 0, 100% 100%, 100% 0); }
&:nth-child(1) {
left: 0;
}
&:nth-child(2) {
right: 0;
transform: scaleX(-1);
}
&:nth-child(3),
&:nth-child(4) {
position: absolute;
z-index: -1;
top: 20%;
width: 40%;
height: 100%;
background: var(--ribbon-color-3);
clip-path: polygon(0 0, 25% 50%, 0 100%, 100% 100%, 100% 0);
}
&:nth-child(3) {
left: -20%;
}
&:nth-child(4) {
right: -20%;
transform: scaleX(-1);
}
} }