Commit c2180752 authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

WebUI[MD refresh]: style cr-radio-button closer to paper-radio-button

A min-height was only supposed to apply within settings, so this CL
moves that back.

Even after that though, the cr-radio-button would have a forced 40px
height due to how disc-wrapper and ripples were styled. This CL adjusts
the styling such that the circle only takes up 16x16 space in the layout,
and instead the ripple is absolutely positioned and out of the layout.

Note that settings has styling to override min-height and padding
of cr-radio-buttons, so visuals before and after this CL is unchanged, but
this will make replacing paper-radio-button with cr-radio-button
outside of settings easier.

Bug: 840527
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Idc7d52cd8ced581bd81ac682cadf97ae4948fb55
Reviewed-on: https://chromium-review.googlesource.com/1060517Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Scott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559341}
parent d1036c3e
...@@ -105,6 +105,11 @@ ...@@ -105,6 +105,11 @@
color: var(--google-blue-500); color: var(--google-blue-500);
} }
controlled-radio-button,
cr-radio-button {
min-height: var(--settings-row-min-height);
}
paper-radio-group { paper-radio-group {
width: 100%; width: 100%;
} }
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
align-items: center; align-items: center;
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
min-height: 48px;
outline: none; outline: none;
} }
...@@ -51,19 +50,15 @@ ...@@ -51,19 +50,15 @@
} }
.disc-wrapper { .disc-wrapper {
height: var(--cr-radio-button-ink-size); height: var(--cr-radio-button-size);
margin: 0 calc(-1 * var(--ink-to-circle));
position: relative; position: relative;
width: var(--cr-radio-button-ink-size); width: var(--cr-radio-button-size);
} }
.disc-border, .disc-border,
.disc { .disc {
box-sizing: border-box; box-sizing: border-box;
height: var(--cr-radio-button-size); height: var(--cr-radio-button-size);
left: var(--ink-to-circle);
position: absolute;
top: var(--ink-to-circle);
width: var(--cr-radio-button-size); width: var(--cr-radio-button-size);
} }
...@@ -77,6 +72,8 @@ ...@@ -77,6 +72,8 @@
.disc { .disc {
background-color: transparent; background-color: transparent;
position: absolute;
top: 0;
transform: scale(0); transform: scale(0);
transition: border-color 200ms, transform 200ms; transition: border-color 200ms, transform 200ms;
} }
...@@ -89,6 +86,18 @@ ...@@ -89,6 +86,18 @@
paper-ripple { paper-ripple {
--paper-ripple-opacity: 0.1; --paper-ripple-opacity: 0.1;
color: var(--google-grey-900); color: var(--google-grey-900);
height: var(--cr-radio-button-ink-size);
left: calc(-1 * var(--ink-to-circle));
pointer-events: none;
position: absolute;
top: calc(-1 * var(--ink-to-circle));
transition: color linear 80ms;
width: var(--cr-radio-button-ink-size);
}
:host-context([dir=rtl]) paper-ripple {
left: auto;
right: calc(-1 * var(--ink-to-circle));
} }
:host([checked]) paper-ripple { :host([checked]) paper-ripple {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment