Skip to content

Commit 69ffcfc

Browse files
committed
updated to the latest select
1 parent 64fa1b3 commit 69ffcfc

5 files changed

Lines changed: 184 additions & 43 deletions

File tree

css/main.css

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -283,26 +283,6 @@ section.examples li {
283283
#pageNav li {
284284
border-bottom: 1px solid #58595A;
285285
}
286-
287-
select.docNav {
288-
-moz-border-radius: 3px;
289-
-webkit-border-radius: 3px;
290-
border-radius: 3px;
291-
background: #595B5B;
292-
background-image: none;
293-
box-shadow: 0 0 0 1px #303233;
294-
border: none;
295-
border-top: 2px solid #666767;
296-
color: #FFF;
297-
text-shadow: 0 -1px 0 #000;
298-
overflow: hidden;
299-
font-size: 14px;
300-
-moz-box-sizing: border-box;
301-
box-sizing: border-box;
302-
padding: 20px;
303-
-webkit-appearance: none;
304-
-moz-appearance: button;
305-
}
306286
@media screen and (min-width: 650px) {
307287
#site.open {
308288
transform: translate3d(0, 0, 0);
@@ -380,24 +360,6 @@ select.docNav {
380360
body.light #pageNav li {
381361
border-bottom: 1px solid #E0E0E0;
382362
}
383-
select.docNav {
384-
background: #595B5B;
385-
box-shadow: 0 0 0 1px #303233;
386-
border: none;
387-
border-top: 2px solid #666767;
388-
color: #FFF;
389-
text-shadow: 0 -1px 0 #000;
390-
padding: 3px 20px 4px 8px;
391-
-webkit-appearance: none;
392-
}
393-
body.light select.docNav {
394-
box-shadow: 0 0 0 1px #949696;
395-
background: #DDE1E1;
396-
border-top: 1px solid #FFF;
397-
color: #454545;
398-
text-shadow: 0 -1px 0 #FFF;
399-
width: 192px;
400-
}
401363
}
402364
@media screen and (min-width: 880px) {
403365
#content {

css/topcoat-select.css

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/**
2+
*
3+
* Copyright 2012 Adobe Systems Inc.;
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
.topcoat-select {
19+
padding: 0;
20+
margin: 0;
21+
font: inherit;
22+
color: inherit;
23+
background: transparent;
24+
border: none;
25+
}
26+
27+
.topcoat-select {
28+
vertical-align: top;
29+
outline: none;
30+
}
31+
32+
.topcoat-select {
33+
cursor: default;
34+
-webkit-user-select: none;
35+
-moz-user-select: none;
36+
-ms-user-select: none;
37+
user-select: none;
38+
}
39+
40+
.topcoat-select {
41+
-moz-box-sizing: border-box;
42+
box-sizing: border-box;
43+
background-clip: padding-box;
44+
}
45+
46+
.topcoat-select {
47+
position: relative;
48+
display: inline-block;
49+
vertical-align: top;
50+
}
51+
52+
.topcoat-select:disabled {
53+
opacity: 0.3;
54+
cursor: default;
55+
pointer-events: none;
56+
}
57+
58+
.topcoat-select {
59+
-moz-appearance: none;
60+
-webkit-appearance: none;
61+
}
62+
63+
.topcoat-select::-ms-expand {
64+
display: none;
65+
}
66+
67+
/* topdoc
68+
name: Topcoat Select
69+
description: A component that lets you select things
70+
modifiers:
71+
:disabled: Disabled state
72+
:focus: Focused
73+
:invalid: Hover state
74+
markup:
75+
<select class="topcoat-select">
76+
<option value="volvo">Volvo</option>
77+
<option value="saab">Saab</option>
78+
<option value="mercedes">Mercedes</option>
79+
<option value="audi">Audi</option>
80+
</select>
81+
<select class="topcoat-select" disabled>
82+
<option value="volvo">Volvo</option>
83+
<option value="saab">Saab</option>
84+
<option value="mercedes">Mercedes</option>
85+
<option value="audi">Audi</option>
86+
</select>
87+
tags:
88+
- desktop
89+
- mobile
90+
- text
91+
- input
92+
*/
93+
94+
.topcoat-select {
95+
-webkit-user-select: none;
96+
-moz-user-select: none;
97+
-ms-user-select: none;
98+
user-select: none;
99+
cursor: pointer;
100+
appearance: button;
101+
text-indent: 0.01px;
102+
text-overflow: '';
103+
padding: .06rem 1.4rem .06rem 0.4rem;
104+
font-size: 12px;
105+
font-weight: 400;
106+
height: 1.313rem;
107+
letter-spacing: 0;
108+
color: hsla(0, 0%, 27%, 1);
109+
text-shadow: 0 1px hsla(0, 100%, 100%, 1);
110+
border-radius: 4px;
111+
background-color: hsla(165, 8%, 91%, 1);
112+
box-shadow: inset 0 1px hsla(0, 100%, 100%, 1);
113+
border: 1px solid hsla(168, 8%, 65%, 1);
114+
background-image: url('img/dropdown.svg');
115+
background-repeat: no-repeat;
116+
background-position: center right;
117+
min-width: 3.4rem;
118+
}
119+
120+
.topcoat-select:hover {
121+
background-color: hsla(180, 7%, 94%, 1);
122+
}
123+
124+
.topcoat-select:active {
125+
background-color: hsla(180, 5%, 83%, 1);
126+
box-shadow: inset 0 1px hsla(0, 0%, 0%, 0.1);
127+
}
128+
129+
.topcoat-select:focus {
130+
border: 1px solid hsla(227, 100%, 50%, 1);
131+
box-shadow: 0 0 0 2px hsla(208, 82%, 69%, 1);
132+
outline: 0;
133+
}
134+
.dark .topcoat-select {
135+
color: hsla(180, 2%, 78%, 1);
136+
text-shadow: 0 -1px hsla(0, 0%, 0%, 0.69);
137+
background-color: hsla(180, 1%, 35%, 1);
138+
box-shadow: inset 0 1px hsla(0, 0%, 45%, 1);
139+
border: 1px solid hsla(180, 1%, 20%, 1);
140+
}
141+
.dark .topcoat-select:hover {
142+
background-color: hsla(200, 2%, 39%, 1);
143+
}
144+
.dark .topcoat-select:active {
145+
background-color: hsla(210, 2%, 25%, 1);
146+
box-shadow: inset 0 1px hsla(0, 0%, 0%, 0.05);
147+
}
148+
@media screen and (max-width: 650px) {
149+
.topcoat-select {
150+
color: hsla(180, 2%, 78%, 1);
151+
text-shadow: 0 -1px hsla(0, 0%, 0%, 0.69);
152+
background-color: hsla(180, 1%, 35%, 1);
153+
box-shadow: inset 0 1px hsla(0, 0%, 45%, 1);
154+
border: 1px solid hsla(180, 1%, 20%, 1);
155+
padding: 0.7rem 1.4rem 0.7rem 1rem;
156+
font-size: 16px;
157+
height: 3rem;
158+
letter-spacing: 1px;
159+
border-radius: 6px;
160+
}
161+
.topcoat-select:hover {
162+
background-color: hsla(200, 2%, 39%, 1);
163+
}
164+
.topcoat-select:active {
165+
background-color: hsla(210, 2%, 25%, 1);
166+
box-shadow: inset 0 1px hsla(0, 0%, 0%, 0.05);
167+
}
168+
}
169+
170+
171+

img/dropdown.svg

Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)