css实现中性checkbox复选框美化效果代码
代码语言:html
所属分类:表单美化
代码描述:css实现中性checkbox复选框美化效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: "Mona Sans";
src: url("https://assets.codepen.io/64/Mona-Sans.woff2") format("woff2 supports variations"), url("https://assets.codepen.io/64/Mona-Sans.woff2") format("woff2-variations");
font-weight: 100 1000;
}
@layer properties {
@property --checkbox-color-hue {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --checkbox-color-saturation {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --checkbox-color-lightness {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --checkbox-color-light-lightness {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --icon-opacity {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --icon-invert {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --icon-size {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --negative-shadow-offset {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
@property --text-opacity {
syntax: "<number>";
inherits: true;
initial-value: 0;
}
}
:root {
/* -- Colors: */
--body-bg-color: hsl(221deg 16% 12%);
--checkbox-color-hue: 216;
--checkbox-color-saturation: 17;
--checkbox-color-lightness: 15;
--checkbox-color: hsl(
calc(var(--checkbox-color-hue) * 1deg) /**/
calc(var(--checkbox-color-saturation) * 1%) /**/
calc(var(--checkbox-color-lightness) * 1%) /**/
);
--checkbox-color-light: rgba(255 255 255 / 32%);
--checkbox-color-dark: rgba(0 0 0 / 45%);
/* -- Box */
--checkbox-border-radius: 24%;
--checkbox-width: 36;
--checkbox-height: 36;
--text-opacity: 0.6;
--negative-shadow-offset: 500;
--active-shadow-opacity: 0;
/* -- icon */
--icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' class='feather feather-che.........完整代码请登录后点击上方下载按钮下载查看
网友评论0