JSFiddle - React, Tailwind, and code Playground
by Plippie Plop
HTML
<div class="container">
<button type="button" class="actionbtn btn-outline btn-green btn " ><i class="fa fa-check-square"></i></button>
<button type="button" class="actionbtn btn-outline btn-grey btn " >
<i class="fa fa-check-square"></i>
</button>
<div class="flex-h-break"></div>
<button type="button" class="actionbtn btn-outline btn-green Enabled-NC btn " ><i class="fa fa-check-square"></i></button>
<button type="button" class="actionbtn btn-outline btn-grey Enabled-NC btn " ><i class="fa fa-check-square"></i></button>
</div>
<div class="container">
<div class="toggle-switch">
<input type="checkbox" name="check01" id="check-slide" />
<label for="check-slide">Round <span></span></label>
</div>
</div>
CSS
:root {
--application-depth-one: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
--form-toggle-off-color: rgb(139, 136, 167);
--form-toggle-off-background: rgb(242, 241, 246);
--form-toggle-off-border: rgb(211, 211, 222);
--form-toggle-on-background: rgb(105, 244, 117);
--form-toggle-on-color: rgb(22, 16, 78);
--form-toggle-on-border: rgb(76, 213, 88);
}
.container {
display: flex;
flex-wrap: wrap;
background-color: rgba(0, 0, 0, 0.01);
padding: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.2);
}
.flex-h-break{
flex:1 1 auto;
width:100%;
height: 0;
}
.btn {
position: relative;
display: inline-block;
margin: 0;
line-height: inherit;
background: none;
background-image: none;
background-position: inherit;
text-shadow: none;
text-decoration: none;
border: 0;
vertical-align: middle;
box-shadow: none;
border-radius: 0.1em;
padding: 0.25em 0.8em;
font-size: 0.9rem;
font-weight: 600;
outline: none;
outline-offset: 0;
cursor: pointer;
white-space: nowrap;
}
.btn.actionbtn.Enabled-NC{
pointer-events: none;
opacity:0.6;
}
.btn.actionbtn.btn-green,
.btn.actionbtn.btn-grey {
flex:0 0 auto;
border-radius: 5rem;
margin: 0.25rem;
padding: 0.01rem;
width: 2.2rem;
height: 1.2rem;
}
.btn.actionbtn.btn-green .fa,
.btn.actionbtn.btn-grey .fa {
display: block;
border-radius: 5rem;
height: 1rem;
width: 1rem;
border: 1px solid var(--application-text-disabled-color);
-webkit-transition: 0.3s ease-in-out;
transition: 0.3s ease-in-out;
}
/* btn-grey toggle off */
.btn.actionbtn.btn-grey {
border: 1px solid var(--form-toggle-off-border);
background-color: var(--form-toggle-off-background);
}
.btn.actionbtn.btn-grey:focus {
box-shadow: var(--application-depth-one);
}
.btn.actionbtn.btn-grey .fa {
background-color: var(--form-toggle-off-color);
}
.btn.actionbtn.btn-green .fa {
background-color: var(--form-toggle-on-color);
margin-left:...