Commit 3cf3629f3b739fcfb63ec8efe5acd8719e057d20
1 parent
653d12ac
update ColorPicker style
Showing
2 changed files
with
34 additions
and
55 deletions
Show diff stats
examples/routers/color-picker.vue
src/styles/components/color-picker.less
1 | 1 | @color-picker-prefix-cls: ~'@{css-prefix}color-picker'; |
2 | 2 | |
3 | +.circle-dot(){ | |
4 | + width: 4px; | |
5 | + height: 4px; | |
6 | + 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); | |
7 | + border-radius: 50%; | |
8 | + transform: translate(-2px, -2px); | |
9 | +} | |
10 | + | |
3 | 11 | .@{color-picker-prefix-cls} { |
4 | 12 | display: inline-block; |
5 | 13 | &-hide { |
... | ... | @@ -9,14 +17,11 @@ |
9 | 17 | } |
10 | 18 | } |
11 | 19 | &-disabled { |
12 | - background-color: @input-disabled-bg; | |
13 | - opacity: 1; | |
14 | - cursor: @cursor-disabled; | |
15 | - color: #ccc; | |
20 | + .disabled(); | |
16 | 21 | } |
17 | 22 | & > div:first-child:hover { |
18 | 23 | .ivu-input { |
19 | - border-color: @input-hover-border-color; | |
24 | + .hover(); | |
20 | 25 | } |
21 | 26 | } |
22 | 27 | & > div:first-child.@{color-picker-prefix-cls}-disabled:hover { |
... | ... | @@ -27,8 +32,12 @@ |
27 | 32 | & .@{select-dropdown-prefix-cls} { |
28 | 33 | padding: 0; |
29 | 34 | } |
35 | + | |
36 | + &-input.ivu-input:focus{ | |
37 | + box-shadow: none; | |
38 | + } | |
30 | 39 | &-focused { |
31 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
40 | + .active(); | |
32 | 41 | } |
33 | 42 | &-rel { |
34 | 43 | line-height: 0; |
... | ... | @@ -55,7 +64,7 @@ |
55 | 64 | } |
56 | 65 | } |
57 | 66 | &-focused { |
58 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
67 | + .active(); | |
59 | 68 | } |
60 | 69 | } |
61 | 70 | &-large &-color { |
... | ... | @@ -98,14 +107,10 @@ |
98 | 107 | &-colors { |
99 | 108 | margin-top: 8px; |
100 | 109 | overflow: hidden; |
101 | - outline: 0; | |
102 | - border: 1px solid @input-border-color; | |
110 | + border-radius: 2px; | |
103 | 111 | transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out; |
104 | - &:hover { | |
105 | - border: 1px solid @input-hover-border-color; | |
106 | - } | |
107 | 112 | &:focus { |
108 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
113 | + .active(); | |
109 | 114 | } |
110 | 115 | &-wrapper { |
111 | 116 | display: inline; |
... | ... | @@ -122,25 +127,14 @@ |
122 | 127 | margin: 2px; |
123 | 128 | cursor: pointer; |
124 | 129 | border-radius: 2px; |
125 | - border: 1px solid @input-border-color; | |
126 | - transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out; | |
127 | - &:hover { | |
128 | - border: 1px solid @input-hover-border-color; | |
129 | - } | |
130 | - &:focus { | |
131 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
132 | - } | |
130 | + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); | |
133 | 131 | } |
134 | 132 | &-circle { |
135 | - cursor: pointer; | |
133 | + .circle-dot(); | |
134 | + position: absolute; | |
136 | 135 | top: 10px; |
137 | 136 | left: 10px; |
138 | - position: absolute; | |
139 | - width: 4px; | |
140 | - height: 4px; | |
141 | - 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); | |
142 | - border-radius: 50%; | |
143 | - transform: translate(-2px, -2px); | |
137 | + cursor: pointer; | |
144 | 138 | } |
145 | 139 | } |
146 | 140 | } |
... | ... | @@ -154,16 +148,11 @@ |
154 | 148 | width: 100%; |
155 | 149 | padding-bottom: 75%; |
156 | 150 | position: relative; |
157 | - overflow: hidden; | |
158 | - outline: 0; | |
159 | - border: 1px solid @input-border-color; | |
160 | - box-shadow: @shadow-base; | |
151 | + //overflow: hidden; | |
161 | 152 | transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out; |
162 | - &:hover { | |
163 | - border: 1px solid @input-hover-border-color; | |
164 | - } | |
153 | + | |
165 | 154 | &:focus { |
166 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
155 | + .active(); | |
167 | 156 | } |
168 | 157 | } |
169 | 158 | &, |
... | ... | @@ -187,11 +176,7 @@ |
187 | 176 | position: absolute; |
188 | 177 | } |
189 | 178 | &-circle { |
190 | - width: 4px; | |
191 | - height: 4px; | |
192 | - 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); | |
193 | - border-radius: 50%; | |
194 | - transform: translate(-2px, -2px); | |
179 | + .circle-dot(); | |
195 | 180 | } |
196 | 181 | } |
197 | 182 | |
... | ... | @@ -203,15 +188,11 @@ |
203 | 188 | left: 0; |
204 | 189 | border-radius: 2px; |
205 | 190 | background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); |
206 | - outline: 0; | |
207 | - border: 1px solid @input-border-color; | |
208 | - box-shadow: @shadow-base; | |
191 | + | |
209 | 192 | transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out; |
210 | - &:hover { | |
211 | - border: 1px solid @input-hover-border-color; | |
212 | - } | |
193 | + | |
213 | 194 | &:focus { |
214 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
195 | + .active(); | |
215 | 196 | } |
216 | 197 | &-container { |
217 | 198 | cursor: pointer; |
... | ... | @@ -241,15 +222,12 @@ |
241 | 222 | right: 0; |
242 | 223 | bottom: 0; |
243 | 224 | left: 0; |
244 | - outline: 0; | |
245 | - border: 1px solid @input-border-color; | |
246 | - box-shadow: @shadow-base; | |
225 | + border-radius: 2px; | |
226 | + | |
247 | 227 | transition: border @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out; |
248 | - &:hover { | |
249 | - border: 1px solid @input-hover-border-color; | |
250 | - } | |
228 | + | |
251 | 229 | &:focus { |
252 | - box-shadow: 0 0 0 2px fade(@input-hover-border-color, 20%); | |
230 | + .active(); | |
253 | 231 | } |
254 | 232 | &-checkboard-wrap { |
255 | 233 | position: absolute; | ... | ... |