Color keyboard control
This commit is contained in:
parent
b924d14da3
commit
f2bcd4adaf
13 changed files with 1314 additions and 653 deletions
|
@ -1,103 +1,174 @@
|
|||
@color-picker-prefix-cls: ~"@{css-prefix}color-picker";
|
||||
@color-picker-prefix-cls: ~'@{css-prefix}color-picker';
|
||||
|
||||
.@{color-picker-prefix-cls} {
|
||||
display: inline-block;
|
||||
&-hide {
|
||||
display: none;
|
||||
&-drop {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
&-disabled {
|
||||
background-color: @input-disabled-bg;
|
||||
opacity: 1;
|
||||
cursor: @cursor-disabled;
|
||||
color: #ccc;
|
||||
}
|
||||
& > div:first-child:hover {
|
||||
.ivu-input {
|
||||
border-color: @input-hover-border-color;
|
||||
}
|
||||
}
|
||||
& > div:first-child.@{color-picker-prefix-cls}-disabled:hover {
|
||||
.ivu-input {
|
||||
border-color: tint(@input-border-color, 20%);
|
||||
}
|
||||
}
|
||||
& .@{select-dropdown-prefix-cls} {
|
||||
padding: 0;
|
||||
}
|
||||
&-rel{
|
||||
&-focused {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
&-rel {
|
||||
line-height: 0;
|
||||
}
|
||||
&-color{
|
||||
&-color {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
|
||||
border-radius: 2px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
div{
|
||||
div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 2px;
|
||||
}
|
||||
&-empty{
|
||||
&-empty {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
i{
|
||||
i {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
&-focused {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
}
|
||||
&-large &-color{
|
||||
&-large &-color {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
top: 1px;
|
||||
&-empty{
|
||||
i{
|
||||
&-empty {
|
||||
i {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-small &-color{
|
||||
&-small &-color {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
top: 3px;
|
||||
&-empty{
|
||||
i{
|
||||
&-empty {
|
||||
i {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-picker{
|
||||
&-wrapper{
|
||||
&-picker {
|
||||
&-wrapper {
|
||||
padding: 8px 8px 0;
|
||||
}
|
||||
&-panel{
|
||||
&-panel {
|
||||
width: 240px;
|
||||
margin: 0 auto;
|
||||
box-sizing: initial;
|
||||
position: relative;
|
||||
}
|
||||
&-hue-slider, &-alpha-slider{
|
||||
&-hue-slider,
|
||||
&-alpha-slider {
|
||||
height: 10px;
|
||||
margin-top: 8px;
|
||||
position: relative;
|
||||
}
|
||||
&-colors{
|
||||
&-colors {
|
||||
margin-top: 8px;
|
||||
overflow: hidden;
|
||||
span{
|
||||
display: inline-block;
|
||||
outline: 0;
|
||||
border: 1px solid @input-border-color;
|
||||
transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
|
||||
&:hover {
|
||||
border: 1px solid @input-hover-border-color;
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
&-wrapper {
|
||||
display: inline;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
float: left;
|
||||
em{
|
||||
position: relative;
|
||||
&-color {
|
||||
outline: 0;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 2px;
|
||||
cursor: pointer;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
|
||||
border: 1px solid @input-border-color;
|
||||
transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
|
||||
&:hover {
|
||||
border: 1px solid @input-hover-border-color;
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
}
|
||||
&-circle {
|
||||
cursor: pointer;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
position: absolute;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
|
||||
border-radius: 50%;
|
||||
transform: translate(-2px, -2px);
|
||||
}
|
||||
}
|
||||
}
|
||||
.@{picker-prefix-cls}-confirm{
|
||||
.@{picker-prefix-cls}-confirm {
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
&-saturation{
|
||||
&-wrapper{
|
||||
&-saturation {
|
||||
&-wrapper {
|
||||
width: 100%;
|
||||
padding-bottom: 75%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
outline: 0;
|
||||
border: 1px solid @input-border-color;
|
||||
box-shadow: @shadow-base;
|
||||
transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
|
||||
&:hover {
|
||||
border: 1px solid @input-hover-border-color;
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
}
|
||||
&, &--white, &--black{
|
||||
&,
|
||||
&--white,
|
||||
&--black {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -105,26 +176,26 @@
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
&--white{
|
||||
background: linear-gradient(to right, #fff, rgba(255,255,255,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));
|
||||
&--black {
|
||||
background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
|
||||
}
|
||||
&-pointer{
|
||||
&-pointer {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
}
|
||||
&-circle{
|
||||
&-circle {
|
||||
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);
|
||||
box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
|
||||
border-radius: 50%;
|
||||
transform: translate(-2px, -2px);
|
||||
}
|
||||
}
|
||||
|
||||
&-hue{
|
||||
&-hue {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -132,35 +203,55 @@
|
|||
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{
|
||||
outline: 0;
|
||||
border: 1px solid @input-border-color;
|
||||
box-shadow: @shadow-base;
|
||||
transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
|
||||
&:hover {
|
||||
border: 1px solid @input-hover-border-color;
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
&-container {
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
&-pointer{
|
||||
&-pointer {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
}
|
||||
&-picker{
|
||||
&-picker {
|
||||
cursor: pointer;
|
||||
margin-top: 1px;
|
||||
width: 4px;
|
||||
border-radius: 1px;
|
||||
height: 8px;
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, .6);
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
|
||||
background: #fff;
|
||||
transform: translateX(-2px);
|
||||
}
|
||||
}
|
||||
|
||||
&-alpha{
|
||||
&-alpha {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
&-checkboard-wrap{
|
||||
outline: 0;
|
||||
border: 1px solid @input-border-color;
|
||||
box-shadow: @shadow-base;
|
||||
transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
|
||||
&:hover {
|
||||
border: 1px solid @input-hover-border-color;
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%);
|
||||
}
|
||||
&-checkboard-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -169,7 +260,7 @@
|
|||
overflow: hidden;
|
||||
border-radius: 2px;
|
||||
}
|
||||
&-checkerboard{
|
||||
&-checkerboard {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -177,7 +268,7 @@
|
|||
left: 0;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
|
||||
}
|
||||
&-gradient{
|
||||
&-gradient {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -185,32 +276,37 @@
|
|||
left: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
&-container{
|
||||
&-container {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
height: 100%;
|
||||
margin: 0 3px;
|
||||
}
|
||||
&-pointer{
|
||||
&-pointer {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
}
|
||||
&-picker{
|
||||
&-picker {
|
||||
cursor: pointer;
|
||||
width: 4px;
|
||||
border-radius: 1px;
|
||||
height: 8px;
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, .6);
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
|
||||
background: #fff;
|
||||
margin-top: 1px;
|
||||
transform: translateX(-2px);
|
||||
}
|
||||
}
|
||||
|
||||
&-confirm{
|
||||
&-confirm {
|
||||
margin-top: 8px;
|
||||
position: relative;
|
||||
&-color{
|
||||
border-top: 1px solid @border-color-split;
|
||||
text-align: right;
|
||||
padding: 8px;
|
||||
clear: both;
|
||||
&-color {
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: 8px;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
}
|
||||
|
||||
.active(@color: @input-hover-border-color) {
|
||||
border-color: tint(@color, 20%);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 2px fade(@color, 20%);
|
||||
}
|
||||
|
@ -266,4 +265,4 @@
|
|||
&-append {
|
||||
border-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue