Skip to content

Instantly share code, notes, and snippets.

@nhatphamcdn
Last active October 21, 2022 14:52
Show Gist options
  • Save nhatphamcdn/fbdf8b92eddd986e697829507a1d6ff9 to your computer and use it in GitHub Desktop.
Save nhatphamcdn/fbdf8b92eddd986e697829507a1d6ff9 to your computer and use it in GitHub Desktop.
Voucher style
$body-bg: red;
@mixin circleBorder($direction: left) {
&::before,
&::after {
content: "";
width: 20px;
height: 20px;
position: absolute;
background: $body-bg;
#{$direction}: -1px;
}
@content;
}
body {
background: $body-bg;
}
.voucher {
display: flex;
width: 100%;
min-height: 15rem;
&-image,
&-info {
position: relative;
padding: 1rem;
border: 1px dashed;
border-radius: 5px;
}
&-image {
width: 25%;
border-right: 0;
padding-right: 0;
@include circleBorder(right) {
&::before {
top: -1px;
border-top: 0;
border-left: 1px dashed;
border-right: 0;
border-bottom: 1px dashed;
border-radius: 0 0 0 20px;
}
&::after {
bottom: -1px;
border-top: 1px dashed;
border-left: 1px dashed;
border-bottom: 0;
border-right: 0;
border-radius: 20px 0 0 0;
}
}
.voucher-content {
border-right: 1px dashed;
min-height: 100%;
}
}
&-info {
width: 75%;
border-left: 0;
background: #CCC;
@include circleBorder(left) {
&::before {
top: -1px;
border-top: 0;
border-left: 0;
border-right: 1px dashed;
border-bottom: 1px dashed;
border-radius: 0 0 20px 0;
}
&::after {
bottom: -1px;
border-top: 1px dashed;
border-left: 0;
border-bottom: 0;
border-right: 1px dashed;
border-radius: 0 20px 0 0;
}
}
}
}
<div class="voucher">
<div class="voucher-image">
<div class="voucher-content">
IMG
</div>
</div>
<div class="voucher-info">
<div class="voucher-content">
INFO
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment