JSFiddle - React, Tailwind, and code Playground
HTML
<div class="hexagon">
<div class="top"></div>
<div class="bottom"></div>
</div>
SCSS
.scale {
margin: 8em auto;
text-align: center;
-webkit-transform:scale(2.5, 2.5);
-moz-transform:scale(2.5, 2.5);
-ms-transform:scale(2.5, 2.5);
-o-transform:scale(2.5, 2.5);
transform:scale(2.5, 2.5);
}
.hex {
position: relative;
display: inline-block;
margin: 0 30px;
width: 60px;
height: 104px;
background-color: #000;
&:before, &:after {
position: absolute;
width: 0;
border: 1px solid transparent;
border-width: (52px) (30px);
content: "";
}
&:before {
border-right-color: #000;
right: 100%;
}
&:after {
border-left-color: #000;
left: 100%;
}
}
.hexagon{
margin-left: 8em;
height: 4em;
width: 4em;
-webkit-transform:scale(2.5, 2.5);
-moz-transform:scale(2.5, 2.5);
-ms-transform:scale(2.5, 2.5);
-o-transform:scale(2.5, 2.5);
transform:scale(2.5, 2.5);
position: relative;
}
.top{
top: 2em;
border-bottom: 2em solid black;
border-left: 1em solid transparent;
border-right: 1em solid transparent;
}
.bottom{
top: 4em;
border-top: 2em solid black;
border-left: 1em solid transparent;
border-right: 1em solid transparent;
}