iview/src/styles/components/color-picker.less

193 lines
4.8 KiB
Text
Raw Normal View History

2017-08-15 16:39:07 +08:00
@color-picker-prefix-cls: ~"@{css-prefix}color-picker";
.@{color-picker-prefix-cls} {
2017-08-16 13:52:50 +08:00
&-rel{
line-height: 0;
}
&-color{
2017-08-16 16:36:17 +08:00
width: 18px;
height: 18px;
2017-08-18 12:27:35 +08:00
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
2017-08-17 10:54:44 +08:00
border-radius: 2px;
2017-08-16 16:36:17 +08:00
position: relative;
top: 2px;
2017-08-18 12:27:35 +08:00
div{
width: 100%;
height: 100%;
box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
border-radius: 2px;
}
2017-08-18 14:38:26 +08:00
&-empty{
background: #fff;
overflow: hidden;
text-align: center;
i{
font-size: 20px;
}
}
2017-08-16 16:36:17 +08:00
}
&-large &-color{
width: 20px;
height: 20px;
top: 1px;
}
&-small &-color{
width: 14px;
height: 14px;
top: 3px;
2017-08-16 13:52:50 +08:00
}
2017-08-17 10:18:38 +08:00
&-picker{
2017-08-17 17:25:38 +08:00
padding: 4px 8px 0;
2017-08-17 10:18:38 +08:00
&-panel{
width: 200px;
margin: 0 auto;
2017-08-17 17:25:38 +08:00
box-sizing: initial;
position: relative;
2017-08-17 10:18:38 +08:00
}
2017-08-17 17:25:38 +08:00
&-hue-slider, &-alpha-slider{
height: 10px;
margin-top: 8px;
position: relative;
2017-08-17 10:18:38 +08:00
}
&-colors{
margin-top: 8px;
2017-08-17 17:25:38 +08:00
overflow: hidden;
2017-08-17 10:18:38 +08:00
span{
display: inline-block;
2017-08-17 17:25:38 +08:00
width: 20px;
height: 20px;
float: left;
2017-08-17 10:18:38 +08:00
em{
display: block;
width: 16px;
height: 16px;
2017-08-17 17:25:38 +08:00
margin: 2px;
2017-08-17 10:18:38 +08:00
cursor: pointer;
border-radius: 2px;
2017-08-17 10:54:44 +08:00
box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
2017-08-17 10:18:38 +08:00
}
}
}
.@{picker-prefix-cls}-confirm{
margin-top: 8px;
}
}
2017-08-17 17:25:38 +08:00
&-saturation{
&-wrapper{
width: 100%;
padding-bottom: 75%;
position: relative;
overflow: hidden;
}
&, &--white, &--black{
cursor: pointer;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&--white{
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}
&--black{
background: linear-gradient(to top, #000, rgba(0,0,0,0));
}
&-pointer{
cursor: pointer;
position: absolute;
}
&-circle{
cursor: head;
width: 4px;
height: 4px;
box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3), 0 0 1px 2px rgba(0,0,0,.4);
border-radius: 50%;
transform: translate(-2px, -2px);
}
}
&-hue{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 2px;
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
&-container{
cursor: pointer;
margin: 0 2px;
position: relative;
height: 100%;
}
&-pointer{
z-index: 2;
position: absolute;
}
&-picker{
cursor: pointer;
margin-top: 1px;
width: 4px;
border-radius: 1px;
height: 8px;
box-shadow: 0 0 2px rgba(0, 0, 0, .6);
background: #fff;
transform: translateX(-2px);
}
}
&-alpha{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
&-checkboard-wrap{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
}
&-checkerboard{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
}
&-gradient{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
&-container{
cursor: pointer;
position: relative;
z-index: 2;
height: 100%;
margin: 0 3px;
}
&-pointer{
z-index: 2;
position: absolute;
}
&-picker{
cursor: pointer;
width: 4px;
border-radius: 1px;
height: 8px;
box-shadow: 0 0 2px rgba(0, 0, 0, .6);
background: #fff;
margin-top: 1px;
transform: translateX(-2px);
}
}
2017-08-15 16:39:07 +08:00
}