lu2
Version:
Simple and flexible UI component library based on native HTML and JavaScript
179 lines (157 loc) • 3.69 kB
CSS
/**
*
* @DropList.css
* @author xinxuzhang
* @create 15-07-01
* @edit 19-10-20 sunmeiye
*
**/
.ui-droplist-x {
position: absolute;
width: 111px;
padding: 7px 0;
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
border: 1px solid #d0d0d5;
border-radius: 4px;
font-size: 14px;
animation: fadeIn .2s;
z-index: 9;
}
.ui-droplist-li {
display: block;
line-height: 20px;
padding: 7px 12px 8px;
color: #4c5161;
text-decoration: none;
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.ui-droplist-hr {
border: 0;
border-bottom: 1px solid #d0d0d5;
margin: 7px 12px;
opacity: .4;
}
a.ui-droplist-li:hover {
color: #4c5161;
background-color: #f0f7ff;
}
a.ui-droplist-li:hover::after {
background-position: 0 -20px;
}
span.ui-droplist-li {
color: #a2a9b6;
cursor: default;
}
.ui-droplist-li[data-sublist]::before {
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
margin-top: 1px;
float: right;
}
.ui-droplist-x > .selected {
background-color: #f1f9fe;
}
.selected + .ui-droplist-xx > .ui-droplist-x {
display: block;
}
.ui-droplist-xx {
position: relative;
}
.ui-droplist-xx > .ui-droplist-x {
display: none;
left: calc(100% - 5px);
top: -35px;
}
.ui-droplist-xx > .reverse {
left: auto;
right: calc(100% - 5px);
}
.ui-droplist-arrow:empty,
.ui-droplist-arrow:not(:empty)::after,
.ui-droplist-li[data-sublist]::before {
content: '';
display: inline-block;
width: 20px;
height: 20px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-205 197 200 400'%3E%3Cpath d='M-59.7 271.6c-4.2-4.1-11-4.1-15.3 0l-30.5 29.6-30.5-29.6c-4.2-4.1-11-4.1-15.3 0-4.2 4.1-4.2 10.7 0 14.8l38.2 37c4.2 4.1 11 4.1 15.3 0l38.2-37c4.1-4.1 4.1-10.7-.1-14.8z' fill='%23a2a9b6'/%3E%3Cpath d='M-58.7 471.6c-4.2-4.1-11-4.1-15.3 0l-30.5 29.6-30.5-29.6c-4.2-4.1-11-4.1-15.3 0-4.2 4.1-4.2 10.7 0 14.8l38.2 37c4.2 4.1 11 4.1 15.3 0l38.2-37c4.1-4.1 4.1-10.7-.1-14.8z' fill='%232a80eb'/%3E%3C/svg%3E"), none;
background-size: 20px 40px;
vertical-align: -5px;
}
a:hover .ui-droplist-arrow:empty,
.ui-droplist-arrow:not(:empty):hover::after {
background-position: 0 -20px;
}
/**
*
* @DropPanel.css
* @author xinxuzhang
* @create 15-07-01
*
**/
.ui-dropanel-x {
position: absolute;
width: 260px;
padding: 20px;
background-color: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
border: 1px solid #d0d0d5;
border: 0 rgba(0, 0, 0, 0.2);
font-size: 14px;
animation: fadeIn .2s;
z-index: 9;
}
.ui-dropanel-title {
line-height: 20px;
margin-top: -2px;
margin-bottom: 0;
font-size: 14px;
font-weight: bold;
}
.ui-dropanel-close {
position: absolute;
top: 3px; right: 2px;
width: 40px; height: 40px;
border: 0;
background: none;
margin: 0; padding: 0;
transition: fill .2s;
fill: #b6bbc6;
cursor: pointer;
z-index: 1;
}
.ui-dropanel-close svg {
width: 20px;
height: 20px;
}
.ui-dropanel-close:hover {
background-color: #4c5161;
fill: #4c5161;
background: none, none;
}
.ui-dropanel-content {
display: block;
min-height: 40px;
padding: 10px 0 20px;
}
.ui-dropanel-footer {
text-align: right;
}
.ui-dropanel-footer .ui-button {
margin-left: 15px;
}
.ui-dropanel-footer .ui-button:first-child {
margin-left: 0;
}
@media (prefers-reduced-motion: reduce) {
.ui-datalist-x,
.ui-dropanel-x {
animation: none;
}
.ui-dropanel-close {
transition: none;
}
}