Blame view

src/styles/components/color-picker.less 4.39 KB
c6faec44   梁灏   init ColorPicker
1
2
3
  @color-picker-prefix-cls: ~"@{css-prefix}color-picker";
  
  .@{color-picker-prefix-cls} {
b6bda1dc   梁灏   update ColorPicker
4
5
6
7
      &-rel{
          line-height: 0;
      }
      &-color{
9673dcb0   梁灏   update ColorPicker
8
9
          width: 18px;
          height: 18px;
dab39476   梁灏   update ColorPicker
10
11
          box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
          border-radius: 2px;
9673dcb0   梁灏   update ColorPicker
12
13
14
15
16
17
18
19
20
21
22
23
          position: relative;
          top: 2px;
      }
      &-large &-color{
          width: 20px;
          height: 20px;
          top: 1px;
      }
      &-small &-color{
          width: 14px;
          height: 14px;
          top: 3px;
b6bda1dc   梁灏   update ColorPicker
24
      }
9af2f01c   梁灏   update ColorPicker
25
26
  
      &-picker{
e7893a68   梁灏   update ColorPicker
27
          padding: 4px 8px 0;
9af2f01c   梁灏   update ColorPicker
28
29
          &-panel{
              width: 200px;
9af2f01c   梁灏   update ColorPicker
30
              margin: 0 auto;
e7893a68   梁灏   update ColorPicker
31
32
              box-sizing: initial;
              position: relative;
9af2f01c   梁灏   update ColorPicker
33
          }
e7893a68   梁灏   update ColorPicker
34
35
36
37
          &-hue-slider, &-alpha-slider{
              height: 10px;
              margin-top: 8px;
              position: relative;
9af2f01c   梁灏   update ColorPicker
38
39
40
          }
          &-colors{
              margin-top: 8px;
e7893a68   梁灏   update ColorPicker
41
              overflow: hidden;
9af2f01c   梁灏   update ColorPicker
42
43
              span{
                  display: inline-block;
e7893a68   梁灏   update ColorPicker
44
45
46
                  width: 20px;
                  height: 20px;
                  float: left;
9af2f01c   梁灏   update ColorPicker
47
48
49
50
                  em{
                      display: block;
                      width: 16px;
                      height: 16px;
e7893a68   梁灏   update ColorPicker
51
                      margin: 2px;
9af2f01c   梁灏   update ColorPicker
52
53
                      cursor: pointer;
                      border-radius: 2px;
dab39476   梁灏   update ColorPicker
54
                      box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
9af2f01c   梁灏   update ColorPicker
55
56
57
                  }
              }
          }
9af2f01c   梁灏   update ColorPicker
58
59
60
61
          .@{picker-prefix-cls}-confirm{
              margin-top: 8px;
          }
      }
e7893a68   梁灏   update ColorPicker
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
  
      &-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);
          }
      }
c6faec44   梁灏   init ColorPicker
179
  }