Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/webui/resources/html/md_select_css.html

Issue 2825403003: WebUI: Improve calculation of md-select text and arrow spacing. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 .md-select,
8 .md-select-underline { 8 .md-select-underline {
9 --md-side-padding: 12px; 9 --md-side-padding: 12px;
10 } 10 }
11 11
12 .md-select { 12 .md-select {
13 --md-arrow-width: 0.9em; 13 --md-arrow-width: 0.9em;
14
15 /* The offset of the arrow from the end of the underline */
Dan Beam 2017/04/19 21:16:11 nit: i think this should technically end with a .
dpapad 2017/04/19 21:53:22 Done.
16 --md-arrow-offset: 3%;
17
14 -webkit-appearance: none; 18 -webkit-appearance: none;
15 -webkit-margin-end: calc(-1 * var(--md-side-padding)); 19 -webkit-margin-end: calc(-1 * var(--md-side-padding));
16 /* Ensure that the text does not overlap with the down arrow. */ 20 /* Ensure that there is a 3px space between the text and the arrow . */
17 -webkit-padding-end: calc(var(--md-side-padding) + 21 -webkit-padding-end: calc(var(--md-side-padding) +
18 var(--md-arrow-width) * 1.8); 22 var(--md-arrow-offset) + var(--md-arrow-width) + 3px);
19 -webkit-padding-start: var(--md-side-padding); 23 -webkit-padding-start: var(--md-side-padding);
20 background: url( 24 background: url(
21 chrome://resources/images/arrow_down.svg) 25 chrome://resources/images/arrow_down.svg)
22 calc(97% - var(--md-side-padding)) center no-repeat; 26 calc(100% - var(--md-arrow-offset) - var(--md-side-padding))
27 center no-repeat;
23 background-size: var(--md-arrow-width); 28 background-size: var(--md-arrow-width);
24 border: none; 29 border: none;
25 color: var(--primary-text-color); 30 color: var(--primary-text-color);
26 cursor: pointer; 31 cursor: pointer;
27 font-family: inherit; 32 font-family: inherit;
28 font-size: inherit; 33 font-size: inherit;
29 outline: none; 34 outline: none;
30 padding-bottom: 4px; 35 padding-bottom: 4px;
31 padding-top: 3px; 36 padding-top: 3px;
32 width: calc(var(--md-select-width, 200px) + 2 * var(--md-side-padding)); 37 width: calc(var(--md-select-width, 200px) + 2 * var(--md-side-padding));
33 } 38 }
34 39
35 /* Mirroring paper-dropdown-menu disabled style. */ 40 /* Mirroring paper-dropdown-menu disabled style. */
36 .md-select[disabled] { 41 .md-select[disabled] {
37 pointer-events: none; 42 pointer-events: none;
38 } 43 }
39 44
40 .md-select[disabled], 45 .md-select[disabled],
41 .md-select[disabled] + .md-select-underline { 46 .md-select[disabled] + .md-select-underline {
42 color: var(--secondary-text-color); 47 color: var(--secondary-text-color);
43 opacity: 0.65; 48 opacity: 0.65;
44 } 49 }
45 50
46 :host-context([dir=rtl]) .md-select { 51 :host-context([dir=rtl]) .md-select {
47 background-position-x: calc(var(--md-side-padding) + 3%); 52 background-position-x: calc(var(--md-side-padding) +
53 var(--md-arrow-offset));
48 } 54 }
49 55
50 /* Persistent underline */ 56 /* Persistent underline */
51 .md-select-underline { 57 .md-select-underline {
52 -webkit-margin-end: 0; 58 -webkit-margin-end: 0;
53 -webkit-margin-start: var(--md-side-padding); 59 -webkit-margin-start: var(--md-side-padding);
54 border-top: 1px solid var(--paper-grey-300); 60 border-top: 1px solid var(--paper-grey-300);
55 display: block; 61 display: block;
56 margin-bottom: 0; 62 margin-bottom: 0;
57 margin-top: 0; 63 margin-top: 0;
(...skipping 26 matching lines...) Expand all
84 border-top: 1px dashed var(--secondary-text-color); 90 border-top: 1px dashed var(--secondary-text-color);
85 } 91 }
86 92
87 .md-select-wrapper { 93 .md-select-wrapper {
88 display: inline-block; 94 display: inline-block;
89 max-width: 100%; 95 max-width: 100%;
90 } 96 }
91 </style> 97 </style>
92 </template> 98 </template>
93 </dom-module> 99 </dom-module>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698