Blame view

src/styles/components/color-picker.less 5.32 KB
c6faec44   梁灏   init ColorPicker
1
2
3
  @color-picker-prefix-cls: ~"@{css-prefix}color-picker";
  
  .@{color-picker-prefix-cls} {
4109bbc6   梁灏   update ColorPicker
4
      display: inline-block;
77950c30   梁灏   update ColorPicker
5
6
7
      & .@{select-dropdown-prefix-cls} {
          padding: 0;
      }
b6bda1dc   梁灏   update ColorPicker
8
9
10
11
      &-rel{
          line-height: 0;
      }
      &-color{
9673dcb0   梁灏   update ColorPicker
12
13
          width: 18px;
          height: 18px;
0aefe4aa   梁灏   update ColorPicker
14
          background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
dab39476   梁灏   update ColorPicker
15
          border-radius: 2px;
9673dcb0   梁灏   update ColorPicker
16
17
          position: relative;
          top: 2px;
0aefe4aa   梁灏   update ColorPicker
18
19
20
21
22
23
          div{
              width: 100%;
              height: 100%;
              box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
              border-radius: 2px;
          }
c0fa72ca   梁灏   update ColorPicker
24
25
26
27
28
          &-empty{
              background: #fff;
              overflow: hidden;
              text-align: center;
              i{
b30250a7   Chavy   fixed: #2219 & Co...
29
                  font-size: 18px;
c0fa72ca   梁灏   update ColorPicker
30
31
              }
          }
9673dcb0   梁灏   update ColorPicker
32
33
34
35
36
      }
      &-large &-color{
          width: 20px;
          height: 20px;
          top: 1px;
b30250a7   Chavy   fixed: #2219 & Co...
37
38
39
40
41
          &-empty{
              i{
                  font-size: 20px;
              }
          }
9673dcb0   梁灏   update ColorPicker
42
43
44
45
46
      }
      &-small &-color{
          width: 14px;
          height: 14px;
          top: 3px;
b30250a7   Chavy   fixed: #2219 & Co...
47
48
49
50
51
          &-empty{
              i{
                  font-size: 14px;
              }
          }
b6bda1dc   梁灏   update ColorPicker
52
      }
9af2f01c   梁灏   update ColorPicker
53
54
  
      &-picker{
77950c30   梁灏   update ColorPicker
55
56
57
          &-wrapper{
              padding: 8px 8px 0;
          }
9af2f01c   梁灏   update ColorPicker
58
          &-panel{
59dc2df0   梁灏   update ColorPicker
59
              width: 240px;
9af2f01c   梁灏   update ColorPicker
60
              margin: 0 auto;
e7893a68   梁灏   update ColorPicker
61
62
              box-sizing: initial;
              position: relative;
9af2f01c   梁灏   update ColorPicker
63
          }
e7893a68   梁灏   update ColorPicker
64
65
66
67
          &-hue-slider, &-alpha-slider{
              height: 10px;
              margin-top: 8px;
              position: relative;
9af2f01c   梁灏   update ColorPicker
68
69
70
          }
          &-colors{
              margin-top: 8px;
e7893a68   梁灏   update ColorPicker
71
              overflow: hidden;
9af2f01c   梁灏   update ColorPicker
72
73
              span{
                  display: inline-block;
e7893a68   梁灏   update ColorPicker
74
75
76
                  width: 20px;
                  height: 20px;
                  float: left;
9af2f01c   梁灏   update ColorPicker
77
78
79
80
                  em{
                      display: block;
                      width: 16px;
                      height: 16px;
e7893a68   梁灏   update ColorPicker
81
                      margin: 2px;
9af2f01c   梁灏   update ColorPicker
82
83
                      cursor: pointer;
                      border-radius: 2px;
dab39476   梁灏   update ColorPicker
84
                      box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
9af2f01c   梁灏   update ColorPicker
85
86
87
                  }
              }
          }
9af2f01c   梁灏   update ColorPicker
88
89
90
91
          .@{picker-prefix-cls}-confirm{
              margin-top: 8px;
          }
      }
e7893a68   梁灏   update ColorPicker
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
  
      &-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{
e7893a68   梁灏   update ColorPicker
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
              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;
1f61a559   梁灏   update ColorPicker
170
              border-radius: 2px;
e7893a68   梁灏   update ColorPicker
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
          }
          &-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;
1f61a559   梁灏   update ColorPicker
186
              border-radius: 2px;
e7893a68   梁灏   update ColorPicker
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
          }
          &-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);
          }
      }
59dc2df0   梁灏   update ColorPicker
210
211
212
213
214
215
216
217
218
  
      &-confirm{
          position: relative;
          &-color{
              position: absolute;
              top: 11px;
              left: 8px;
          }
      }
b30250a7   Chavy   fixed: #2219 & Co...
219
  }