From 16721e6c8bc74a6ea56a7b5d4c8701b273a41c1b Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Sat, 30 Sep 2017 10:26:22 +0100 Subject: [PATCH] Update gr-button to use paper button Mostly styling updates but notable changes: - Common color in theme.html, should be used by all buttons and links. - CSS mixin to style gr-button passed to paper button (used in gr-label-score-row, gr-linked-chip) - Some things that look like buttons but aren't exactly buttons get text-transform uppercase to appear like a button. - Primary and secondary buttons are both the same color, but for now - have not removed secondary so that it's possible to style them differently if we decide to. Change-Id: Ib5ef3b0fc4883cd6dfc5c38e6d954925101d531f --- .../gr-change-actions/gr-change-actions.js | 2 +- .../gr-change-metadata.html | 6 + .../gr-change-metadata/gr-change-metadata.js | 4 +- .../gr-file-list-header.js | 2 +- .../gr-file-list-header_test.html | 4 +- .../change/gr-file-list/gr-file-list.html | 2 +- .../gr-label-score-row.html | 27 +-- .../gr-label-score-row/gr-label-score-row.js | 2 + .../gr-messages-list_test.html | 20 ++- .../gr-reply-dialog/gr-reply-dialog.html | 4 - .../core/gr-main-header/gr-main-header.html | 6 +- .../diff/gr-diff-view/gr-diff-view.html | 4 +- .../gr-syntax-themes/gr-theme-default.html | 2 +- .../gr-menu-editor/gr-menu-editor.html | 4 + .../gr-settings-view/gr-settings-view.html | 1 + .../gr-watched-projects-editor.html | 3 +- .../gr-account-chip/gr-account-chip.html | 36 ++-- .../elements/shared/gr-button/gr-button.html | 166 ++++++++---------- .../elements/shared/gr-button/gr-button.js | 5 + .../shared/gr-dropdown/gr-dropdown.html | 25 +-- .../shared/gr-dropdown/gr-dropdown.js | 1 + .../gr-editable-label/gr-editable-label.html | 7 +- .../gr-editable-label/gr-editable-label.js | 5 + .../shared/gr-linked-chip/gr-linked-chip.html | 36 ++-- polygerrit-ui/app/styles/app-theme.html | 5 + polygerrit-ui/app/styles/shared-styles.html | 3 + 26 files changed, 201 insertions(+), 181 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js index f69e3937ac..9210d1fe81 100644 --- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js +++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js @@ -666,7 +666,7 @@ _handleActionTap(e) { e.preventDefault(); - const el = Polymer.dom(e).rootTarget; + const el = e.currentTarget; const key = el.getAttribute('data-action-key'); if (key.startsWith(ADDITIONAL_ACTION_KEY_PREFIX)) { this.fire(`${key}-tap`, {node: el}); diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html index cbaf605042..559157db99 100644 --- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html +++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html @@ -107,6 +107,9 @@ limitations under the License. opacity: 0; pointer-events: none; } + .hashtagChip { + margin-bottom: .5em; + } #externalStyle { display: block; } @@ -222,6 +225,7 @@ limitations under the License.
  • - + Browse
  • diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html index 008852e199..e4aaa2b29b 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html @@ -85,7 +85,6 @@ limitations under the License. vertical-align: middle; } .dropdown-trigger { - color: #00e; cursor: pointer; padding: 0; } @@ -111,7 +110,7 @@ limitations under the License. width: .3em; } .dropdown-content a:hover { - background-color: #00e; + background-color: var(--color-link); color: #fff; } .dropdown-content a[selected] { @@ -125,7 +124,6 @@ limitations under the License. color: #000; } gr-button { - font: inherit; padding: .3em 0; text-decoration: none; } diff --git a/polygerrit-ui/app/elements/diff/gr-syntax-themes/gr-theme-default.html b/polygerrit-ui/app/elements/diff/gr-syntax-themes/gr-theme-default.html index 31a276f99c..311a5af90c 100644 --- a/polygerrit-ui/app/elements/diff/gr-syntax-themes/gr-theme-default.html +++ b/polygerrit-ui/app/elements/diff/gr-syntax-themes/gr-theme-default.html @@ -60,7 +60,7 @@ limitations under the License. color: #219; } .gr-syntax-type { - color: #00f; + color: var(--color-link); } .gr-syntax-title { color: #0000C0; diff --git a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.html b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.html index fa3428aa4d..6805885b12 100644 --- a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.html +++ b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.html @@ -59,18 +59,21 @@ limitations under the License. [[item.url]] Delete @@ -99,6 +102,7 @@ limitations under the License. Add diff --git a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html index cacccdac01..7764d3babf 100644 --- a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html +++ b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html @@ -353,6 +353,7 @@ limitations under the License. id="emailEditor" has-unsaved-changes="{{_emailsChanged}}"> Save changes diff --git a/polygerrit-ui/app/elements/settings/gr-watched-projects-editor/gr-watched-projects-editor.html b/polygerrit-ui/app/elements/settings/gr-watched-projects-editor/gr-watched-projects-editor.html index a834ea2a61..68b2c23daa 100644 --- a/polygerrit-ui/app/elements/settings/gr-watched-projects-editor/gr-watched-projects-editor.html +++ b/polygerrit-ui/app/elements/settings/gr-watched-projects-editor/gr-watched-projects-editor.html @@ -83,6 +83,7 @@ limitations under the License. Delete @@ -106,7 +107,7 @@ limitations under the License. placeholder="branch:name, or other search expression"> - Add + Add diff --git a/polygerrit-ui/app/elements/shared/gr-account-chip/gr-account-chip.html b/polygerrit-ui/app/elements/shared/gr-account-chip/gr-account-chip.html index 90594de331..b6580256a8 100644 --- a/polygerrit-ui/app/elements/shared/gr-account-chip/gr-account-chip.html +++ b/polygerrit-ui/app/elements/shared/gr-account-chip/gr-account-chip.html @@ -37,24 +37,31 @@ limitations under the License. :host([show-avatar]) .container { padding-left: 0; } - gr-button.remove, gr-button.remove:hover, gr-button.remove:focus { - border-color: transparent; - color: #333; + --gr-button: { + color: #333; + } } gr-button.remove { - background: #eee; - border: 0; - color: #666; - font-size: 1.7em; - font-weight: normal; - height: .6em; - line-height: .6em; - margin-left: .15em; - margin-top: -.05em; - padding: 0; - text-decoration: none; + --gr-button: { + border: 0; + color: #666; + font-size: 1.7em; + font-weight: normal; + height: .6em; + line-height: .6em; + margin-left: .15em; + margin-top: -.05em; + padding: 0; + text-decoration: none; + } + --gr-button-hover-color: { + color: #333; + } + --gr-button-hover-background-color: { + color: #333; + } } :host:focus { border-color: transparent; @@ -78,6 +85,7 @@ limitations under the License.