| 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, |
| 8 .md-select-underline { |
| 9 --md-side-padding: 12px; |
| 10 } |
| 11 |
| 7 .md-select { | 12 .md-select { |
| 8 --md-arrow-width: 0.9em; | 13 --md-arrow-width: 0.9em; |
| 9 -webkit-appearance: none; | 14 -webkit-appearance: none; |
| 10 /* Ensure that the text does not overlap with the down arrow. */ | 15 /* Ensure that the text does not overlap with the down arrow. */ |
| 11 -webkit-padding-end: calc(var(--md-arrow-width) * 1.8); | 16 -webkit-padding-end: calc(var(--md-side-padding) + |
| 17 var(--md-arrow-width) * 1.8); |
| 18 -webkit-padding-start: var(--md-side-padding); |
| 12 background: url( | 19 background: url( |
| 13 chrome://resources/images/arrow_down.svg) 97% center no-repeat; | 20 chrome://resources/images/arrow_down.svg) |
| 21 calc(97% - var(--md-side-padding)) center no-repeat; |
| 14 background-size: var(--md-arrow-width); | 22 background-size: var(--md-arrow-width); |
| 15 border-bottom: 1px solid var(--paper-grey-300); | 23 border: none; |
| 16 border-left: none; | |
| 17 /* Override Mac's default border-radius */ | |
| 18 border-radius: 0; | |
| 19 border-right: none; | |
| 20 border-top: none; | |
| 21 color: var(--primary-text-color); | 24 color: var(--primary-text-color); |
| 22 cursor: pointer; | 25 cursor: pointer; |
| 23 font-family: inherit; | 26 font-family: inherit; |
| 24 font-size: inherit; | 27 font-size: inherit; |
| 25 outline: none; | 28 outline: none; |
| 26 padding-bottom: 3px; | 29 padding-bottom: 4px; |
| 27 padding-top: 3px; | 30 padding-top: 3px; |
| 28 width: var(--md-select-width, 200px); | 31 width: var(--md-select-width, 200px); |
| 29 } | 32 } |
| 30 | 33 |
| 31 /* Mirroring paper-dropdown-menu disabled style. */ | 34 /* Mirroring paper-dropdown-menu disabled style. */ |
| 32 .md-select[disabled] { | 35 .md-select[disabled] { |
| 33 border-bottom: 1px dashed var(--secondary-text-color); | 36 border-bottom: 1px dashed var(--secondary-text-color); |
| 34 color: var(--secondary-text-color); | 37 color: var(--secondary-text-color); |
| 35 opacity: 0.65; | 38 opacity: 0.65; |
| 36 pointer-events: none; | 39 pointer-events: none; |
| 37 } | 40 } |
| 38 | 41 |
| 39 :host-context([dir=rtl]) .md-select { | 42 :host-context([dir=rtl]) .md-select { |
| 40 background-position-x: 3%; | 43 background-position-x: calc(var(--md-side-padding) + 3%); |
| 41 } | 44 } |
| 42 | 45 |
| 46 /* Persistent underline */ |
| 43 .md-select-underline { | 47 .md-select-underline { |
| 48 border-top: 1px solid var(--paper-grey-300); |
| 49 display: block; |
| 50 margin: 0 var(--md-side-padding); |
| 51 } |
| 52 |
| 53 /* Focus underline */ |
| 54 .md-select-underline::after { |
| 44 border-top: 2px solid var(--google-blue-500); | 55 border-top: 2px solid var(--google-blue-500); |
| 56 content: ''; |
| 45 display: block; | 57 display: block; |
| 58 transform: scale3d(0, 1, 1); |
| 59 transition: transform 200ms ease-in; |
| 60 } |
| 61 |
| 62 /* Force the thicker "focus" underline to be properly overlapping with the |
| 63 * "persistent" underline, and also make it visible by 1px while the |
| 64 * <select> is expanded. */ |
| 65 .md-select-underline, |
| 66 .md-select-underline::after { |
| 46 position: relative; | 67 position: relative; |
| 47 top: -1px; | 68 top: -1px; |
| 48 transform: scale3d(0, 1, 1); | |
| 49 transition: transform 200ms ease-in; | |
| 50 width: 100%; | |
| 51 } | 69 } |
| 52 | 70 |
| 53 .md-select:focus + .md-select-underline { | 71 .md-select:focus + .md-select-underline::after { |
| 54 transform: scale3d(1, 1, 1); | 72 transform: scale3d(1, 1, 1); |
| 55 transition: transform 200ms ease-out; | 73 transition: transform 200ms ease-out; |
| 56 } | 74 } |
| 57 | 75 |
| 58 .md-select-wrapper { | 76 .md-select-wrapper { |
| 59 display: inline-block; | 77 display: inline-block; |
| 60 max-width: 100%; | 78 max-width: 100%; |
| 61 } | 79 } |
| 62 </style> | 80 </style> |
| 63 </template> | 81 </template> |
| 64 </dom-module> | 82 </dom-module> |
| OLD | NEW |