Coder Wrap provides free to use snippets Coder Wrap provides free to use snippets

🗙
Login
Register

Create Account

Cancel
Back to HTML
Preview Source Code
Download
HTML
CSS
/**Typeo CSS Start if(Don't use Remove)**/
* {
    box-sizing: border-box;
}

body {
    margin: 0px;
    background-color: #f8fffc;
}

.themes-option {
    margin: 50px auto;
    width: 100%;
    padding: 50px;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    min-height: 800px;
}

.theme-group {
    position: relative;
    margin: auto;
    max-width: 400px;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-flow: row wrap;
}

/**Typeo CSS Start if(Don't use Remove)**/

/**Theme Option CSS Start**/


.theme-group {
    position: relative;
    margin: auto;
    max-width: 400px;
    width: 100%;
}

.theme-group .theme-label {
    position: relative;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 20px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: inline-block;
    border: #ccc 1px solid;
    border-radius: 4px;
    cursor: pointer;
    color: #414141;
    margin-bottom: 6px;
    background-color: #ffffff;
}

.theme-group .theme-label:after {
    content: '';
    width: 6px;
    height: 6px;
    border-left: #414141 2px solid;
    border-bottom: #414141 2px solid;
    display: inline-block;
    border-radius: 2px;
    margin-left: 8px;
    transform: rotate(-45deg);
    position: relative;
    top: -3px;
    transition: 0.5s all;
}

.theme-group .theme-label-show:after {
    transform: rotate(135deg);
    top: 1px;
}

.theme-opt {
    background-color: #ffffff;
    position: absolute;
    left: 0px;
    right: 0px;
    margin: auto;
    top: 170%;
    width: 200px;
    box-shadow: #e0e0e0 0 0 14px;
    padding: 12px;
    border-radius: 6px;
    border: #e0e0e0 1px solid;
    transition: 0.5s all;
    opacity: 0;
    pointer-events: none;
}

.theme-opt-show {
    opacity: 1;
    top: 100%;
    pointer-events: auto;
}

.theme-opt .opt-item {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    padding: 8px 10px;
    cursor: pointer;
    transition: 0.5s all;
    border-radius: 6px;
}

.theme-opt .opt-item svg {
    margin-right: 8px;
}

.theme-opt .opt-item:hover {
    background-color: #e7e7e7;
}

/**Theme Option CSS End**/
JS
document.querySelector('.theme-label').addEventListener('click', function(e){
  document.querySelector('.theme-label').classList.toggle('theme-label-show');
  document.querySelector('.theme-opt').classList.toggle('theme-opt-show');
});

Related Snippets

Leave a comment

Your email address will not be published. Required fields are marked *