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

Unified Diff: ui/webui/resources/html/md_select_css.html

Issue 2814813002: WebUI: Add left/right padding on md-select. (Closed)
Patch Set: Address nits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/html/md_select_css.html
diff --git a/ui/webui/resources/html/md_select_css.html b/ui/webui/resources/html/md_select_css.html
index 7217ff3b03f4683a3c36d40e5aed41bab249f6a9..59f97c7e58b24232771cff478505b0e1aada921b 100644
--- a/ui/webui/resources/html/md_select_css.html
+++ b/ui/webui/resources/html/md_select_css.html
@@ -4,26 +4,29 @@
<dom-module id="md-select">
<template>
<style>
+ .md-select,
+ .md-select-underline {
+ --md-side-padding: 12px;
+ }
+
.md-select {
--md-arrow-width: 0.9em;
-webkit-appearance: none;
/* Ensure that the text does not overlap with the down arrow. */
- -webkit-padding-end: calc(var(--md-arrow-width) * 1.8);
+ -webkit-padding-end: calc(var(--md-side-padding) +
+ var(--md-arrow-width) * 1.8);
+ -webkit-padding-start: var(--md-side-padding);
background: url(
- chrome://resources/images/arrow_down.svg) 97% center no-repeat;
+ chrome://resources/images/arrow_down.svg)
+ calc(97% - var(--md-side-padding)) center no-repeat;
background-size: var(--md-arrow-width);
- border-bottom: 1px solid var(--paper-grey-300);
- border-left: none;
- /* Override Mac's default border-radius */
- border-radius: 0;
- border-right: none;
- border-top: none;
+ border: none;
color: var(--primary-text-color);
cursor: pointer;
font-family: inherit;
font-size: inherit;
outline: none;
- padding-bottom: 3px;
+ padding-bottom: 4px;
padding-top: 3px;
width: var(--md-select-width, 200px);
}
@@ -37,20 +40,35 @@
}
:host-context([dir=rtl]) .md-select {
- background-position-x: 3%;
+ background-position-x: calc(var(--md-side-padding) + 3%);
}
+ /* Persistent underline */
.md-select-underline {
+ border-top: 1px solid var(--paper-grey-300);
+ display: block;
+ margin: 0 var(--md-side-padding);
+ }
+
+ /* Focus underline */
+ .md-select-underline::after {
border-top: 2px solid var(--google-blue-500);
+ content: '';
display: block;
- position: relative;
- top: -1px;
transform: scale3d(0, 1, 1);
transition: transform 200ms ease-in;
- width: 100%;
}
- .md-select:focus + .md-select-underline {
+ /* Force the thicker "focus" underline to be properly overlapping with the
+ * "persistent" underline, and also make it visible by 1px while the
+ * <select> is expanded. */
+ .md-select-underline,
+ .md-select-underline::after {
+ position: relative;
+ top: -1px;
+ }
+
+ .md-select:focus + .md-select-underline::after {
transform: scale3d(1, 1, 1);
transition: transform 200ms ease-out;
}
« 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