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 2825403003: WebUI: Improve calculation of md-select text and arrow spacing. (Closed)
Patch Set: Add missing period. 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 f9a8062ca2d57c38ec145e4f78e55e138ca1f4b4..2eb49a79276c030c119f9ba802f8cd2d7e3a1447 100644
--- a/ui/webui/resources/html/md_select_css.html
+++ b/ui/webui/resources/html/md_select_css.html
@@ -11,15 +11,20 @@
.md-select {
--md-arrow-width: 0.9em;
+
+ /* The offset of the arrow from the end of the underline. */
+ --md-arrow-offset: 3%;
+
-webkit-appearance: none;
-webkit-margin-end: calc(-1 * var(--md-side-padding));
- /* Ensure that the text does not overlap with the down arrow. */
+ /* Ensure that there is a 3px space between the text and the arrow. */
-webkit-padding-end: calc(var(--md-side-padding) +
- var(--md-arrow-width) * 1.8);
+ var(--md-arrow-offset) + var(--md-arrow-width) + 3px);
-webkit-padding-start: var(--md-side-padding);
background: url(
chrome://resources/images/arrow_down.svg)
- calc(97% - var(--md-side-padding)) center no-repeat;
+ calc(100% - var(--md-arrow-offset) - var(--md-side-padding))
+ center no-repeat;
background-size: var(--md-arrow-width);
border: none;
color: var(--primary-text-color);
@@ -44,7 +49,8 @@
}
:host-context([dir=rtl]) .md-select {
- background-position-x: calc(var(--md-side-padding) + 3%);
+ background-position-x: calc(var(--md-side-padding) +
+ var(--md-arrow-offset));
}
/* Persistent underline */
« 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