css实现亮色和暗色切换模式下的单选多选radio checkbox美化效果代码

代码语言:html

所属分类:表单美化

代码描述:css实现亮色和暗色切换模式下的单选多选radio checkbox美化效果代码

代码标签: css 亮色 暗色 切换 模式 单选 多选 radio checkbox 美化

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
   
<meta charset="UTF-8">
   
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/unicons.css">
<style>
    /* Please ❤ this if you like it! */


@import url('https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&subset=devanagari,latin-ext');


:root {
        --white: #ffffff;
        --light: #f0eff3;
        --black: #000000;
        --dark-blue: #1f2029;
        --dark-light: #353746;
        --red: #da2c4d;
        --yellow: #f8ab37;
        --grey: #ecedf3;
}

/* #Primary
================================================== */

body{
        width: 100%;
        background: var(--dark-blue);
        overflow-x: hidden;
    font-family: 'Poppins', sans-serif;
        font-size: 17px;
        line-height: 30px;
        -webkit-transition: all 300ms linear;
        transition: all 300ms linear;
}
p{
    font-family: 'Poppins', sans-serif;
        font-size: 17px;
        line-height: 30px;
        color: var(--white);
        letter-spacing: 1px;
        font-weight: 500;
        -webkit-transition: all 300ms linear;
        transition: all 300ms linear;
}
::selection {
        color: var(--white);
        background-color: var(--black);
}
::-moz-selection {
        color: var(--white);
        background-color: var(--black);
}
mark{
        color: var(--white);
        background-color: var(--black);
}
.section {
    position: relative;
        width: 100%;
        display: block;
        text-align: center;
        margin: 0 auto;
}
.over-hide {
    overflow: hidden;
}
.z-bigger {
    z-index: 100 !important;
}


.background-color{
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--dark-blue);
        z-index: 1;
        -webkit-transition: all 300ms linear;
        transition: all 300ms linear;
}
.checkbox:checked ~ .background-color{
        background-color: var(--white);
}


[type="checkbox"]:checked,
[type="checkbox"]:not(:checked),
[type="radio"]:checked,
[type="radio"]:not(:checked){
        position: absolute;
        left: -9999px;
        width: 0;
        height: 0;
        visibility: hidden;
}
.checkbox:checked + label,
.checkbox:not(:checked) + label{
        position: relative;
        width: 70px;
        display: inline-block;
        padding: 0;
        margin: 0 auto;
        text-align: center;
        margin: 17px 0;
        margin-top: 100px;
        height: 6px;
        border-radius: 4px;
        background-image: linear-gradient(298deg, var(--red), var(--yellow));
        z-index: 100 !important;
}
.checkbox:checked + label:before,
.checkbox:not(:checked) + label:before {
        position: absolute;
        font-family: 'unicons';
        cursor: pointer;
        top: -17px;
        z-index: 2;
        font-size: 20px;
        line-height: 40px;
        text-align: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        -webkit-transition: all 300ms linear;
        transition: all 300ms linear;
}
.checkbox:not(:checked) + label:before {
        content: '\eac1';
        left: 0;
        color: var(--grey);
        background-color: var(--dark-light);
        box-shadow: 0 4px 4px rgba(0,0,0,0.15), 0 0 0 1px rgba(26,53,71,0.07);
}
.checkbox:checked + label:before {
        content: '\eb8f';
        left: 30px;
        color: var(--yellow);
        background-color: var(--dark-blue);
        box-shadow: 0 4px 4px rgba(26,53,71,0.25), 0 0 0 1px rgba(26,53,71,0.07);
}

.checkbox:checked ~ .section .container .row .col-12 p{
        color: var(--dark-blue);
}


.checkbox-tools:checked + label,
.checkbox-tools:not(:checked) + label{
        position: relative;
        display: inline-block;
        padding: 20px;
        width: 110px;
        font-size: 14px;
        line-height: 20px;
        letter-spacing: 1px;
        margin: 0 auto;
        margin-left: 5px;
        margin-right: 5px;
        margin-bottom: 10px;
        text-align: cen.........完整代码请登录后点击上方下载按钮下载查看

网友评论0