vue实现可更改主题色的ui组件库布局效果代码
代码语言:html
所属分类:布局界面
代码描述:vue实现可更改主题色的ui组件库布局效果代码,包含表单相关组件,列表,按钮等元素。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Encode+Sans:400,500,600,700'>
<style>
:root {
--primary-1: #F44336;
--primary-2: #1E88E5;
--primary-3: #FDD835;
--border: #CDD9ED;
--border-hover: #99A3BA;
--text-color: #6C7486;
--text-color-headline: #3F4656;
--shadow: rgba(22, 30, 50, .04);
}
body {
font-family: "Encode Sans";
font-size: 16px;
line-height: 22px;
color: var(--text-color);
background: #F5F9FF;
}
.form-field {
--color: var(--primary-1);
outline: none;
display: block;
width: 100%;
-webkit-appearance: none;
background: #fff;
border: 1px solid var(--border);
padding: 8px 16px;
line-height: 22px;
font-size: 14px;
font-weight: 500;
color: var(--text-color);
border-radius: 6px;
transition: border 0.3s ease;
}
.form-field::-moz-placeholder {
color: var(--border-hover);
}
.form-field:-ms-input-placeholder {
color: var(--border-hover);
}
.form-field::placeholder {
color: var(--border-hover);
}
.form-field:focus {
outline: none;
border-color: var(--color);
}
.form-element {
margin-bottom: 20px;
}
.form-element label {
display: block;
margin-bottom: 4px;
font-size: 14px;
color: var(--text-color-headline);
font-weight: 500;
}
.iconList {
margin: 0;
padding: 0;
list-style: none;
}
.iconList li {
--color: var(--primary-1);
margin: 0 0 20px 0;
border: 1px solid var(--border);
border-radius: 6px;
padding: 12px;
}
.iconList li:last-child {
margin-bottom: 0;
}
.iconList li a {
display: flex;
align-items: center;
position: relative;
text-decoration: none;
}
.iconList li a .icon {
width: 44px;
height: 44px;
position: relative;
margin-right: 12px;
}
.iconList li a .icon:before {
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
border-radius: 50%;
display: block;
background: var(--color);
opacity: 0.1;
}
.iconList li a .icon svg {
display: block;
position: absolute;
left: 50%;
top: 50%;
width: 20px;
height: 20px;
fill: var(--color);
transform: translate(-50%, -50%);
}
.iconList li a .text {
color: var(--text-color-headline);
font-weight: 600;
font-size: 14px;
}
.iconList li a .text small {
display: block;
font-size: 12px;
font-weight: 500;
opacity: 0.75;
color: var(--text-color);
}
.iconList li a > svg {
position: absolute;
display: block;
right: 0;
top: 50%;
transform: translateY(-50%);
transition: transform 0.3s ease;
fill: var(--border-hover);
}
.iconList li a:hover > svg {
transform: translateY(-50%) translateX(2px);
}
.radioGroup {
--color: var(--primary-1);
--border-width: 2px;
display: flex;
font-size: 14px;
font-weight: 600;
}
.radioGroup label {
cursor: pointer;
}
.radioGroup label input {
display: none;
}
.radioGroup label input + span {
display: block;
position: relative;
padding: 7px 20px;
border: var(--border-width) solid var(--border);
transition: background 0.3s ease, border-color 0.3s ease;
}
.radioGroup label input:checked + span {
z-index: 2;
background: var(--color);
border-color: var(--color);
color: #fff;
}
.radioGroup label:hover input + span {
z-index: 1;
border-color: var(--color);
}
.radioGroup label:first-child input + span {
border-radius: 6px 0 0 6px;
}
.radioGroup label:last-child input + span {
border-radius: 0 6px 6px 0;
}
.radioGroup label:not(:first-child) {
margin-left: calc(var(--border-width) * -1);
}
.checkbox,
.radio,
.switch {
--color: var(--primary-1);
--border-hover: var(--primary-1);
--border-width: 2px;
margin: 0 0 12px 0;
display: table;
cursor: pointer;
}
.checkbox.inline,
.radio.inline,
.switch.inline {
margin: 0 12px 0 0;
display: inline-block;
}
.checkbox input,
.radio input,
.switch input {
display: none;
}
.checkbox input + span,
.radio input + span,
.switch input + span {
color: var(--text-color);
height: 22px;
font-size: 14px;
font-weight: 500;
position: relative;
display: block;
}
.checkbox input + span:before, .checkbox input + span:after,
.radio input + span:before,
.radio input + span:after,
.switch input + span:before,
.switch input + span:after {
content: "";
display: block;
left: 0;
top: 0;
position: absolute;
}
.checkbox input + span:before,
.radio input + span:before,
.switch input + span:before {
height: 22px;
border: var(--border-width) solid var(--border);
background: #fff;
transition: background 0.3s ease, border-color 0.3s ease;
}
.checkbox input + span:after,
.radio input + span:after,
.switch input + span:after {
transition: transform 0.3s ease, opacity 0.2s ease, background 0.2s ease;
}
.checkbox input:checked + span:before,
.radio input:checked + span:before,
.switch input:checked + span:before {
background: var(--color);
border-color: var(--color);
}
.checkbox input:checked + span:after,
.radio input:checked + span:after,
.switch input:checked + span:after {
transition: opacity 0.3s ease, background 0.3s ease, transform 0.6s cubic-bezier(0.175, 0.88, 0.32, 1.2);
}
.checkbox:hover input:not(:checked) + span:before,
.radio:hover input:not(:checked) + span:before,
.switch:hover input:not(:chec.........完整代码请登录后点击上方下载按钮下载查看
网友评论0