OLD | NEW |
1 <link rel="import" href="chrome://resources/html/polymer.html"> | 1 <link rel="import" href="chrome://resources/html/polymer.html"> |
2 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html
"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html
"> |
3 | 3 |
4 <dom-module id="md-select"> | 4 <dom-module id="md-select"> |
5 <template> | 5 <template> |
6 <style> | 6 <style> |
7 .md-select, | 7 :root { |
8 .md-select-underline { | 8 --md-select-side-padding: 12px; |
9 --md-side-padding: 12px; | |
10 } | 9 } |
11 | 10 |
12 .md-select { | 11 .md-select { |
13 --md-arrow-width: 0.9em; | 12 --md-arrow-width: 0.9em; |
14 | 13 |
15 /* The offset of the arrow from the end of the underline. */ | 14 /* The offset of the arrow from the end of the underline. */ |
16 --md-arrow-offset: 3%; | 15 --md-arrow-offset: 3%; |
17 | 16 |
18 -webkit-appearance: none; | 17 -webkit-appearance: none; |
19 -webkit-margin-end: calc(-1 * var(--md-side-padding)); | 18 -webkit-margin-end: calc(-1 * var(--md-select-side-padding)); |
20 /* Ensure that there is a 3px space between the text and the arrow. */ | 19 /* Ensure that there is a 3px space between the text and the arrow. */ |
21 -webkit-padding-end: calc(var(--md-side-padding) + | 20 -webkit-padding-end: calc(var(--md-select-side-padding) + |
22 var(--md-arrow-offset) + var(--md-arrow-width) + 3px); | 21 var(--md-arrow-offset) + var(--md-arrow-width) + 3px); |
23 -webkit-padding-start: var(--md-side-padding); | 22 -webkit-padding-start: var(--md-select-side-padding); |
24 background: url( | 23 background: url( |
25 chrome://resources/images/arrow_down.svg) | 24 chrome://resources/images/arrow_down.svg) |
26 calc(100% - var(--md-arrow-offset) - var(--md-side-padding)) | 25 calc(100% - var(--md-arrow-offset) - var(--md-select-side-padding)) |
27 center no-repeat; | 26 center no-repeat; |
28 background-size: var(--md-arrow-width); | 27 background-size: var(--md-arrow-width); |
29 border: none; | 28 border: none; |
30 color: var(--primary-text-color); | 29 color: var(--primary-text-color); |
31 cursor: pointer; | 30 cursor: pointer; |
32 font-family: inherit; | 31 font-family: inherit; |
33 font-size: inherit; | 32 font-size: inherit; |
34 outline: none; | 33 outline: none; |
35 padding-bottom: 4px; | 34 padding-bottom: 4px; |
36 padding-top: 3px; | 35 padding-top: 3px; |
37 width: calc(var(--md-select-width, 200px) + 2 * var(--md-side-padding)); | 36 width: calc(var(--md-select-width, 200px) + 2 * var(--md-select-side-pad
ding)); |
38 } | 37 } |
39 | 38 |
40 /* Mirroring paper-dropdown-menu disabled style. */ | 39 /* Mirroring paper-dropdown-menu disabled style. */ |
41 .md-select[disabled] { | 40 .md-select[disabled] { |
42 pointer-events: none; | 41 pointer-events: none; |
43 } | 42 } |
44 | 43 |
45 .md-select[disabled], | 44 .md-select[disabled], |
46 .md-select[disabled] + .md-select-underline { | 45 .md-select[disabled] + .md-select-underline { |
47 color: var(--secondary-text-color); | 46 color: var(--secondary-text-color); |
48 opacity: 0.65; | 47 opacity: 0.65; |
49 } | 48 } |
50 | 49 |
51 :host-context([dir=rtl]) .md-select { | 50 :host-context([dir=rtl]) .md-select { |
52 background-position-x: calc(var(--md-side-padding) + | 51 background-position-x: calc(var(--md-select-side-padding) + |
53 var(--md-arrow-offset)); | 52 var(--md-arrow-offset)); |
54 } | 53 } |
55 | 54 |
56 /* Persistent underline */ | 55 /* Persistent underline */ |
57 .md-select-underline { | 56 .md-select-underline { |
58 -webkit-margin-end: 0; | 57 -webkit-margin-end: 0; |
59 -webkit-margin-start: var(--md-side-padding); | 58 -webkit-margin-start: var(--md-select-side-padding); |
60 border-top: 1px solid var(--paper-grey-300); | 59 border-top: 1px solid var(--paper-grey-300); |
61 display: block; | 60 display: block; |
62 margin-bottom: 0; | 61 margin-bottom: 0; |
63 margin-top: 0; | 62 margin-top: 0; |
64 } | 63 } |
65 | 64 |
66 /* Focus underline */ | 65 /* Focus underline */ |
67 .md-select-underline::after { | 66 .md-select-underline::after { |
68 border-top: 2px solid var(--google-blue-500); | 67 border-top: 2px solid var(--google-blue-500); |
69 content: ''; | 68 content: ''; |
(...skipping 20 matching lines...) Expand all Loading... |
90 border-top: 1px dashed var(--secondary-text-color); | 89 border-top: 1px dashed var(--secondary-text-color); |
91 } | 90 } |
92 | 91 |
93 .md-select-wrapper { | 92 .md-select-wrapper { |
94 display: inline-block; | 93 display: inline-block; |
95 max-width: 100%; | 94 max-width: 100%; |
96 } | 95 } |
97 </style> | 96 </style> |
98 </template> | 97 </template> |
99 </dom-module> | 98 </dom-module> |
OLD | NEW |