We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$border-poses: top, right, bottom, left; $border-color: #eee; @mixin border-1px($color: $border-color, $poses: $border-poses) { position: relative; &::after { content: ''; display: block; position: absolute; width: 100%; @each $pos in $poses { border-#{$pos}: 1px solid $color; #{$pos}: 0; } @if $poses == 'top' or $poses == 'bottom' { left: 0; right: 0; transform: scaleY(0.5); } @if $poses == 'left' or $poses == 'right' { top: 0; bottom: 0; transform: scaleX(0.5); } } }
<div class="need-1px-border">需要1px边框线的元素, 红色, 在下方</div>
.need-1px-border { @include border-1px(red, bottom); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
mixin 定义
用法
The text was updated successfully, but these errors were encountered: