Вот вам go с решением jsfiddle Link
$(document).ready(function(){
$(".theme-button").click(function(){
if ($(".theme-colors").hasClass("shown")) {
$(".theme-colors").removeClass("shown");
} else {
$(".theme-colors").addClass("shown");
}
});
});
.theme-colors.shown {
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.theme-colors {
width: 280px;
position: fixed;
z-index: 1030;
top: 50%;
right: 0;
background: #fff;
-webkit-box-shadow: 0 1px 15px rgba(0,0,0,.04), 0 1px 6px rgba(0,0,0,.04);
box-shadow: 0 1px 15px rgba(0,0,0,.04), 0 1px 6px rgba(0,0,0,.04);
-webkit-transform: translate(280px,-50%);
transform: translate(280px,-50%);
-webkit-transition: -webkit-transform .4s ease-out;
transition: -webkit-transform .4s ease-out;
transition: transform .4s ease-out;
transition: transform .4s ease-out,-webkit-transform .4s ease-out;
padding-top: 10px;
padding-bottom: 10px;
}
body {
font-family: Nunito,sans-serif;
font-size: .8rem;
font-weight: 400;
color: #303030;
background: #f8f8f8;
}
.p-4 {
padding: 1.5rem!important;
}
.text-muted {
color: #909090!important;
}
.mb-2, .my-2 {
margin-bottom: .5rem!important;
}
p {
font-size: .85rem;
line-height: 1.3rem;
font-family: Nunito,sans-serif;
}
.justify-content-between {
-webkit-box-pack: justify!important;
-ms-flex-pack: justify!important;
justify-content: space-between!important;
}
.d-flex {
display: -webkit-box!important;
display: -ms-flexbox!important;
display: flex!important;
}
.theme-colors .theme-color-purple {
border: 3px solid #922c88;
background: #922c88;
}
.theme-colors .theme-color {
width: 24px;
height: 24px;
display: inline-block;
border-radius: 20px;
-webkit-transition: background .25s;
transition: background .25s;
}
a {
color: #303030;
-webkit-transition: color .2s;
transition: color .2s;
}
.theme-colors .theme-color-blue {
border: 3px solid #145388;
background: #145388;
}
.theme-colors .theme-color-green {
border: 3px solid #576a3d;
background: #576a3d;
}
.theme-colors .theme-color-orange {
border: 3px solid #e2863b;
background: #e2863b;
}
.theme-colors .theme-color-red {
border: 3px solid #880a1f;
background: #880a1f;
}
.pl-4, .px-4 {
padding-left: 1.5rem!important;
}
.theme-colors .theme-button {
position: absolute;
left: -34px;
background: #fff;
padding: 13px 7px 13px 7px;
border-radius: .2rem;
color: #303030;
-webkit-box-shadow: -2px 0 5px rgba(0,0,0,.04);
box-shadow: -2px 0 5px rgba(0,0,0,.04);
font-size: 20px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
color: #922c88;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="toggleshown" class="theme-colors"><div class="p-4"><p class="text-muted mb-2">Light Theme</p> <div class="d-flex flex-row justify-content-between mb-4"><a href="#" class="theme-color theme-color-purple active"></a><a href="#" class="theme-color theme-color-blue"></a><a href="#" class="theme-color theme-color-green"></a><a href="#" class="theme-color theme-color-orange"></a><a href="#" class="theme-color theme-color-red"></a></div> <p class="text-muted mb-2">Dark Theme</p> <div class="d-flex flex-row justify-content-between"><a href="#" class="theme-color theme-color-purple"></a><a href="#" class="theme-color theme-color-blue"></a><a href="#" class="theme-color theme-color-green"></a><a href="#" class="theme-color theme-color-orange"></a><a href="#" class="theme-color theme-color-red"></a></div></div> <div class="pb-0 pl-4 pt-4"><fieldset class="form-group" id="__BVID__10"><legend tabindex="-1" class="col-form-label pt-0" id="__BVID__10__BV_label_">Border Radius</legend><div tabindex="-1" role="group"><div role="radiogroup" tabindex="-1" class="" id="__BVID__11"><div class="custom-control custom-control-inline custom-radio"><input type="radio" name="radius" autocomplete="off" class="custom-control-input" value="rounded" id="__BVID__12"><label class="custom-control-label" for="__BVID__12">Rounded</label></div> <div class="custom-control custom-control-inline custom-radio"><input type="radio" name="radius" autocomplete="off" class="custom-control-input" value="flat" id="__BVID__13"><label class="custom-control-label" for="__BVID__13">Flat</label></div></div><!----><!----><!----></div></fieldset></div> <a href="#" class="theme-button"><i class="fa fa-cogs"></i></a></div>
Использование .hasClass
свойство
ссылка hasClass Документация
Здесь вы go с чистым JavaScript раствором