JSFiddle - React, Tailwind, and code Playground
by IvanBender
HTML
<div class="sorting">
<div class="sorting__radio">
<span>SORT BY:</span>
<input type="radio" id="price" name="" value="">
<label for="price">Price</label>
<input type="radio" id="revelance" name="" value="">
<label for="revelance">Revelance</label>
<input type="radio" id="newest-arrivals" name="" value="">
<label for="newest-arrivals">Newest arrivals</label>
</div>
<div class="sorting__checkbox">
<span>SHOW BY:</span>
<input type="checkbox" id="all" name="" value="">
<label for="all">All</label>
<input type="checkbox" id="t-shirt" name="" value="">
<label for="t-shirt">T-shirt</label>
<input type="checkbox" id="mockup" name="" value="">
<label for="mockup">Mockup</label>
</div>
<button type="button" class="sorting__btn" name="button">Apply</button>
</div>
SCSS
.sorting {
margin-top: 50px;
padding: 10px;
display: flex;
justify-content: space-around;
label {
font-size: 15px;
line-height: 21px;
color: #171717;
}
span {
font-size: 14px;
line-height: 16px;
display: flex;
align-items: center;
color: #5F5F5F;
}
.sorting__radio {
display: flex;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
border: 1px solid #E0E0E0;
border-radius: 5px;
padding: 0 20px;
max-width: 495px;
max-height: 65px;
flex-grow: 1;
}
.sorting__checkbox {
display: flex;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
border: 1px solid #E0E0E0;
border-radius: 5px;
padding: 0 20px;
max-width: 495px;
max-height: 65px;
margin-left: 20px;
flex-grow: 1;
}
.sorting__btn {
width: 170px;
height: 65px;
margin-left: 20px;
font-size: 15px;
line-height: 21px;
color: #FFFFFF;
border-radius: 5px;
border: 0;
background-color: #3205F3;
}
}
input[type="checkbox"]:checked,
input[type="checkbox"]:not(:checked),
input[type="radio"]:checked,
input[type="radio"]:not(:checked) {
position: absolute;
left: -9999px;
}
input[type="checkbox"]:checked+label,
input[type="checkbox"]:not(:checked)+label,
input[type="radio"]:checked+label,
input[type="radio"]:not(:checked)+label {
display: inline-block;
position: relative;
padding-left: 38px;
line-height: 20px;
cursor: pointer;
}
input[type="checkbox"]:checked+label:before,
input[type="checkbox"]:not(:checked)+label:before,
input[type="radio"]:checked+label:before,
input[type="radio"]:not(:checked)+label:before {
content: "";
position: absolute;
left: 0;
top: -5px;
width: 25px;
height: 25px;
border: 2px solid #BDBDBD;
...