Centering of two hexagons - html

I have two hexagons, one is for the main background and other is for border, but the main inside hex is a little bit out of his place.
.hexagon {
position: relative;
width: 179.1px;
height: 103.40px;
margin: 51.70px 0;
border-left: solid 5px #c94400;
border-right: solid 5px #c94400;
}
.hexagon:before,
.hexagon:after {
content: "";
position: absolute;
z-index: 1;
width: 126.64px;
height: 126.64px;
-webkit-transform: scaleY(0.5774) rotate(-45deg);
-ms-transform: scaleY(0.5774) rotate(-45deg);
transform: scaleY(0.5774) rotate(-45deg);
background-color: inherit;
left: 21.2286px;
}
.hexagon:before {
top: -63.3214px;
border-top: solid 7.0711px #c94400;
border-right: solid 7.0711px #c94400;
}
.hexagon:after {
bottom: -63.3214px;
border-bottom: solid 7.0711px #c94400;
border-left: solid 7.0711px #c94400;
}
.hexagon-inner {
position: relative;
width: 160px;
height: 92.38px;
background-color: rgba(42, 42, 42, 0.66);
margin: 46.19px 0;
}
.hexagon-inner:before,
.hexagon-inner:after {
content: "";
position: absolute;
width: 0;
border-left: 80px solid transparent;
border-right: 80px solid transparent;
}
.hexagon-inner:before {
bottom: 100%;
border-bottom: 46.19px solid rgba(42, 42, 42, 0.66);
}
.hexagon-inner:after {
top: 100%;
width: 0;
border-top: 46.19px solid rgba(42, 42, 42, 0.66);
}
}
<div class="hexagon">
<div class="hexagon-inner"></div>
</div>
How can i put in the middle my main hex to inside borders hex?
i tried to use margins from hexagon div, but both hex moving in the same time. What is the best way to center this hexagons?
How i expect : https://imgur.com/a/aUNHu8L

You can use "Flexbox" for horizontal and vertical center.You can learn in FlexBox Guide.For your solution, Remove margin from hexagon-inner class and add
display: flex;
align-items: center;
justify-content: center;
in hexagon class.

3 hexagons using clip-path - img on img
I offer another solution,
This is nice trick to achieve this, you can use percent or px.
.container {
height: 240px;
width: 240px;
background-image: url(https://wickes.scene7.com/is/image/travisperkins/GPID_1100100003_02?wid=824&hei=618&fit=crop);
background-size: cover;
display: flex;
align-items: center;
justify-content: center;
}
.hexagon {
transform: rotate(30deg);
/* height: 173.2px; */
/* width: 200px; */
height: 69.28%;
width: 80%;
position: relative;
}
.hex {
position: absolute;
clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.hexagon1 {
height: 100%;
width: 100%;
background-color: rgb(201, 68, 0);
}
.hexagon2 {
height: 92%;
width: 92%;
top: 4%;
left: 4%;
}
.copy-background {
transform: rotate(-30deg);
height: 124%;
width: 124%;
position: relative;
top: -12%;
left: -12%;
background-image: url(https://wickes.scene7.com/is/image/travisperkins/GPID_1100100003_02?wid=824&hei=618&fit=crop);
/* background-size: 320px; */
/* background-position: -6px -21px; */
background-size: 146%;
background-position: 10% 50%;
background-repeat: no-repeat;
}
.hexagon3 {
height: 84%;
width: 84%;
top: 8%;
left: 8%;
background-color: rgba(35, 35, 35, 0.7);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
}
.text {
transform: rotate(-30deg);
}
<div class="container">
<div class="hexagon">
<div class="hex hexagon1"></div>
<div class="hex hexagon2">
<div class="copy-background"></div>
</div>
<div class="hex hexagon3">
<span class="text">VONIA</span>
</div>
</div>
</div>
Another solution with not use px or percent, and you can change the position and the attachment - both - in .copy-background and .container
.container {
height: 240px;
width: 240px;
background-image: url(https://wickes.scene7.com/is/image/travisperkins/GPID_1100100003_02?wid=824&hei=618&fit=crop);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
display: flex;
align-items: center;
justify-content: center;
}
.hexagon {
transform: rotate(30deg);
height: 69.28%;
width: 80%;
position: relative;
}
.hex {
position: absolute;
clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.hexagon1 {
height: 100%;
width: 100%;
background-color: rgb(201, 68, 0);
}
.hexagon2 {
height: 92%;
width: 92%;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.copy-background {
overflow: hidden;
top: 0;
left: -18%;
right: 0;
bottom: 0;
margin: auto;
height: 240px;
width: 240px;
transform: rotate(-30deg);
position: absolute;
background-image: url(https://wickes.scene7.com/is/image/travisperkins/GPID_1100100003_02?wid=824&hei=618&fit=crop);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
}
.hexagon3 {
height: 84%;
width: 84%;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
background-color: rgba(35, 35, 35, 0.7);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
}
.text {
transform: rotate(-30deg);
}
<div class="container">
<div class="hexagon">
<div class="hex hexagon1"></div>
<div class="hex hexagon2">
<div class="copy-background"></div>
</div>
<div class="hex hexagon3">
<span class="text">VONIA</span>
</div>
</div>
</div>

Related

how can I draw this shape using CSS ::after and ::before?

I know there are many different ways to draw in CSS but I want to draw this shape using CSS ::before and ::after pseudo-elements.
Only the yellow part I could not draw it.
.body{
width:100%;
height:100%;
background:#191919;
display: flex;
justify-content: center;
align-items: center;
}
.circle {
position: relative;
width: 160px;
height: 160px;
background: #824B20;
border-radius: 50%;
}
.circle::before{
content: "";
width: 100px;
height: 100px;
background: #E08027;
position: absolute;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.circle::after{
content:"";
/*color : #FFF58F */
}
<div class="body"><div class="circle";div><div><div>
An idea using only gradients:
.box {
width: 200px;
aspect-ratio:1;
border-radius: 50%;
background:
radial-gradient(circle at 78% 50%, yellow 4%,#0000 4.5%),
radial-gradient(circle at 22% 50%, yellow 4%,#0000 4.5%),
radial-gradient(at top,#0000 33%,yellow 34% 45%,#0000 46%)
bottom/100% 50% no-repeat,
radial-gradient(#E08027 40%,#824B20 41%);
}
<div class="box"></div>
.body {
width: 100%;
height: 100vh;
background: #191919;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.circle {
box-sizing: border-box;
position: relative;
width: 160px;
height: 160px;
background: #E08027;
border: 30px solid #824B20;
border-radius: 50%;
}
.half-circle {
position: absolute;
width: 85px;
height: 85px;
border: 14px solid #FFF58F;
border-top-color: transparent;
border-left-color: transparent;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
}
.half-circle::before,
.half-circle::after {
content: "";
position: absolute;
top: 69px;
width: 14px;
height: 14px;
border-radius: 50%;
background: #FFF58F;
}
.half-circle::before {
left: 0;
}
.half-circle::after {
left: 71px;
transform: translate(-2px, -70px);
}
<div class="body">
<div class="circle">
<div class="half-circle"></div>
</div>
</div>

How to create parallelogram shaped buttons for a menu in React [duplicate]

I asked this question earlier asking how to skew an assortment of images. I was able to get very satisfying results
.container {
font-size: 0;
height: 215px;
margin: 30px 50px;
text-align: center;
color: black;
}
.box1 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 3px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box2 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box3 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box4 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box5 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box6 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box1 span {
position: absolute;
top: 0;
bottom: 0;
left: -100%;
right: -100%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box2 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box3 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box4 span {
position: absolute;
top: 0;
bottom: 0;
left: -35%;
right: -35%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box5 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box6 span {
position: absolute;
top: 0;
bottom: 0;
left: -35%;
right: -35%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
<div class="container">
<div class="box1"><span style="background-image:url(illustris1.png)"></span></div>
<div class="box2"><span style="background-image:url(gal.png)"></span></div>
<div class="box3"><span style="background-image:url(laniakea.jpg)"></span> </div>
<div class="box4"><span style="background-image:url(globularstar.jpg)"></span></div>
<div class="box5"><span style="background-image:url(elliptical.jpg)"></span></div>
<div class="box6"><span style="background-image:url(illustris2.png)"></span></div>
<div class="container mid"></div>
</div>
While my this snipped of code is lengthy compared to the answered one from the other thread, it allows me to resize for each picture I input.
What I am trying to do now is to have the far left end box1 and the far right end box6 of this container environment to skewed only in the inner portion of this assortment. It is kind of like the result this poster is wanting to get: Skew one side only of an element.
I have been attempting several methods of this for a couple hours and I do not to seem to have luck altering box1 and box6 To have one side skewed while not warping the images.
You can use negative margin for last and first one to hide half the element:
.container {
display: flex;
height: 150px;
margin: 0 30px;
overflow:hidden;
}
.box {
flex: 1;
border: 1px solid;
transform: skew(-25deg);
position: relative;
overflow: hidden;
}
.box:first-child {
margin-left:calc((100% / 5) / -2);
}
.box:last-child {
margin-right:calc((100% / 5) / -2);
}
.box:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-image: var(--i);
background-position: center;
}
<div class="container">
<div class="box" style="--i:url(https://lorempixel.com/400/200/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/400/300/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/300/200/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/400/300/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/200/300/)"></div>
</div>

How do I make a diagonal grid/flexbox? [duplicate]

I asked this question earlier asking how to skew an assortment of images. I was able to get very satisfying results
.container {
font-size: 0;
height: 215px;
margin: 30px 50px;
text-align: center;
color: black;
}
.box1 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 3px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box2 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box3 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box4 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box5 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box6 {
font-size: initial;
width: calc(100% / 6);
height: 100%;
border: 2.5px solid;
box-sizing: border-box;
transform: skew(-25deg);
position: relative;
overflow: hidden;
display: inline-block;
}
.box1 span {
position: absolute;
top: 0;
bottom: 0;
left: -100%;
right: -100%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box2 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box3 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box4 span {
position: absolute;
top: 0;
bottom: 0;
left: -35%;
right: -35%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box5 span {
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
.box6 span {
position: absolute;
top: 0;
bottom: 0;
left: -35%;
right: -35%;
transform: skew(25deg);
background-position: center;
background-size: cover;
}
<div class="container">
<div class="box1"><span style="background-image:url(illustris1.png)"></span></div>
<div class="box2"><span style="background-image:url(gal.png)"></span></div>
<div class="box3"><span style="background-image:url(laniakea.jpg)"></span> </div>
<div class="box4"><span style="background-image:url(globularstar.jpg)"></span></div>
<div class="box5"><span style="background-image:url(elliptical.jpg)"></span></div>
<div class="box6"><span style="background-image:url(illustris2.png)"></span></div>
<div class="container mid"></div>
</div>
While my this snipped of code is lengthy compared to the answered one from the other thread, it allows me to resize for each picture I input.
What I am trying to do now is to have the far left end box1 and the far right end box6 of this container environment to skewed only in the inner portion of this assortment. It is kind of like the result this poster is wanting to get: Skew one side only of an element.
I have been attempting several methods of this for a couple hours and I do not to seem to have luck altering box1 and box6 To have one side skewed while not warping the images.
You can use negative margin for last and first one to hide half the element:
.container {
display: flex;
height: 150px;
margin: 0 30px;
overflow:hidden;
}
.box {
flex: 1;
border: 1px solid;
transform: skew(-25deg);
position: relative;
overflow: hidden;
}
.box:first-child {
margin-left:calc((100% / 5) / -2);
}
.box:last-child {
margin-right:calc((100% / 5) / -2);
}
.box:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: -50%;
right: -50%;
transform: skew(25deg);
background-image: var(--i);
background-position: center;
}
<div class="container">
<div class="box" style="--i:url(https://lorempixel.com/400/200/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/400/300/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/300/200/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/400/300/)"></div>
<div class="box" style="--i:url(https://lorempixel.com/200/300/)"></div>
</div>

How to remove line behind transparent button in CSS

How to remove line behind transparent button in CSS? See Picture Below
How to remove line behind transparent button in CSS? See Picture Below
How to remove line behind transparent button in CSS? See Picture Below
.fullscreen {
height: 100%;
width: 100%;
background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
}
.line {
position: absolute;
width: 3px;
height: 100%;
background-color: rgba(255, 255, 255, 1);
top: 0;
left: 50%;
}
.btn {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid #ffffff;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
z-index: 1;
}
.btn::after {
content: '';
display: block;
width: 60px;
height: 60px;
background: #ffffff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="fullscreen">
<span class="line"></span>
<div class="btn"></div>
</div>
This is more of a hack and might not work for you because you didn't provide any code so far.
My idea was to give the (in my case) .outer_box the same background-image as the .background and scale it the same way.
.fullscreen {
height: 100vh;
width: 100vw;
background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
}
.line {
position: absolute;
width: 3px;
height: 100%;
background-color: rgba(255, 255, 255, 1);
top: 0;
left: 50%;
}
.btn {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid #ffffff;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
z-index: 1;
background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
background-size: 100vw;
}
.btn::after {
content: '';
display: block;
width: 60px;
height: 60px;
background: #ffffff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="fullscreen">
<span class="line"></span>
<div class="btn"></div>
</div>

CSS - Rectangle div with cut corners and border color

I'm trying to achieve the shape as shown in this image:
To have 2 rectangle divs with cut corners , and 1 div positioned behind another div.
But the corners seems incorrect and I can't find the way to show the borders of the shapes.
.wrapper {
display: flex;
justify-content: center;
}
.connect {
width: 254px;
height: 50px;
background: red;
background: #FF2D5069;
border-top: 2px solid #FF2175;
position: absolute;
bottom: 0;
z-index: 5;
}
.connect::before {
content: '';
position: absolute;
bottom: 0;
right: -2px;
border-top: 52px solid white;
border-left: 42px solid transparent;
}
.connect::after {
content: '';
position: absolute;
bottom: 0;
left: -2px;
border-top: 52px solid white;
border-right: 42px solid transparent;
}
.connect-behind {
width: 300px;
height: 44px;
background: red;
background: #FF2D5069;
border-top: 2px solid #FF2175;
position: absolute;
bottom: 0;
}
.connect-behind::before {
content: '';
position: absolute;
bottom: 0;
right: -2px;
border-top: 46px solid white;
border-left: 26px solid transparent;
}
.connect-behind::after {
content: '';
position: absolute;
bottom: 0;
left: -2px;
border-top: 46px solid white;
border-right: 26px solid transparent;
}
<div class="wrapper">
<div class="connect"></div>
<div class="connect-behind"></div>
</div>
I took reference from other threads to use behind and after for the solution but it doesn't seem working correct for my problem. Please help, thanks.
You could use perspective and transform:
possible example (for infos : with grid instead absolute) :
.wrapper {
display: grid;
justify-content: center;
align-items: end;
height: 300px;
perspective: 50px;
}
.connect,
.connect-behind {
transform: rotatex(50deg);
background: red;
margin: 0 auto;
background: #FF2D5069;
border-top: 2px solid #FF2175;
grid-row: 1;
grid-column: 1;
transform-origin: bottom center;
}
.connect-behind {
width: 300px;
height: 44px;
}
.connect {
width: 254px;
height: 50px;
;
}
<div class="wrapper">
<div class="connect"></div>
<div class="connect-behind"></div>
</div>
to draw a border around the shape, drop-shadow could be usefull
.wrapper {
display: grid;
justify-content: center;
align-items: end;
height: 300px;
perspective: 50px;
filter:
drop-shadow( 1px 0px 0 )
drop-shadow(-1px 0px 0 )
drop-shadow( 0px 1px 0 )
drop-shadow( 0px -1px 0 );
}
.connect,
.connect-behind {
transform: rotatex(50deg);
background: red;
margin: 0 auto;
background:white;
grid-row: 1;
grid-column: 1;
transform-origin: bottom center;
background:#ffa500;
}
.connect-behind {
width: 254px;
height: 50px;
border-left:solid 2px;
border-right:solid 2px;
}
.connect {
background:#ed1c24;
width: 300px;
height: 44px;
;
}
<div class="wrapper">
<div class="connect"></div>
<div class="connect-behind"></div>
</div>
You can use clip-path for things like this. Works well in a ( I think ) most browsers. Some, like ie11 and older browsers won't render it correctly, though, so you may need a fallback for those cases.
body {
overflow: hidden;
}
.wrapper {
display: flex;
justify-content: center;
}
.connect {
width: 254px;
height: 80px;
background: red;
background: #FF2D5069;
border-top: 2px solid black;
position: absolute;
bottom: 0;
z-index: 5;
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}
.connect-border-left {
height: 80px;
width: 2px;
background: black;
left: calc(50% - 131px);
position: absolute;
bottom: -12px;
transform: rotate(34deg) translateX(-50%);
display: inline-block;
}
.connect-border-right {
height: 80px;
width: 2px;
background: black;
right: calc(50% - 131px);
position: absolute;
bottom: -12px;
transform: rotate(-34deg) translateX(-50%);
display: inline-block;
}
.connect-behind {
width: 300px;
height: 60px;
background: red;
background: #FF2D5069;
border-top: 2px solid black;
position: absolute;
bottom: 0;
clip-path: polygon(14% 0%, 86% 0%, 100% 100%, 0% 100%);
}
.connect-behind-border-right {
height: 100px;
width: 2px;
background: black;
right: calc(50% - 103px);
position: absolute;
bottom: -11px;
transform: rotate(-32deg) translateX(-50%);
display: inline-block;
}
.connect-behind-border-left {
height: 100px;
width: 2px;
background: black;
left: calc(50% - 103px);
position: absolute;
bottom: -11px;
transform: rotate(32deg) translateX(-50%);
display: inline-block;
}
<div class="wrapper">
<div class="connect"></div>
<div class="connect-border-left"></div>
<div class="connect-border-right"></div>
<div class="connect-behind"></div>
<div class="connect-behind-border-left"></div>
<div class="connect-behind-border-right"></div>
</div>
an idea with skew transformation, clip-path and multiple background:
.box {
--b:3px; /* border width */
--t:20px; /* top part width */
--s:30px; /* side part width */
margin:10px;
display:inline-block;
width:250px;
height:150px;
position:relative;
}
.box::before,
.box::after {
content:"";
position:absolute;
top:0;
bottom:0;
left:0;
width:50%;
border-style:solid;
border-width:var(--b) 0 0 var(--b);
background:
linear-gradient(black 0 0) 0 var(--t)/100% var(--b),
linear-gradient(black 0 0) var(--s) 0/var(--b) 100%,
linear-gradient(red 0 0) left/var(--s) 100%,
orange;
background-repeat:no-repeat;
transform-origin:bottom right;
transform:skew(-20deg);
clip-path:polygon(0 calc(var(--t) + var(--b)), calc(var(--s) + var(--b)) calc(var(--t) + var(--b)),calc(var(--s) + var(--b)) 0,60% 0,100% 100%,0 100%);
}
.box::after {
transform:scale(-1,1) skew(-20deg);
}
<div class="box"></div>
<div class="box" style="--b:2px;--t:30px;--s:15px;"></div>