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
This commit is contained in:
Becky Siegel
2017-09-30 10:26:22 +01:00
parent 4e0da79d07
commit 16721e6c8b
26 changed files with 201 additions and 181 deletions

View File

@@ -666,7 +666,7 @@
_handleActionTap(e) { _handleActionTap(e) {
e.preventDefault(); e.preventDefault();
const el = Polymer.dom(e).rootTarget; const el = e.currentTarget;
const key = el.getAttribute('data-action-key'); const key = el.getAttribute('data-action-key');
if (key.startsWith(ADDITIONAL_ACTION_KEY_PREFIX)) { if (key.startsWith(ADDITIONAL_ACTION_KEY_PREFIX)) {
this.fire(`${key}-tap`, {node: el}); this.fire(`${key}-tap`, {node: el});

View File

@@ -107,6 +107,9 @@ limitations under the License.
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
} }
.hashtagChip {
margin-bottom: .5em;
}
#externalStyle { #externalStyle {
display: block; display: block;
} }
@@ -222,6 +225,7 @@ limitations under the License.
</template> </template>
<template is="dom-if" if="[[!change.topic]]"> <template is="dom-if" if="[[!change.topic]]">
<gr-editable-label <gr-editable-label
uppercase
label-text="Add a topic" label-text="Add a topic"
value="[[change.topic]]" value="[[change.topic]]"
placeholder="[[_computeTopicPlaceholder(_topicReadOnly)]]" placeholder="[[_computeTopicPlaceholder(_topicReadOnly)]]"
@@ -240,6 +244,7 @@ limitations under the License.
<span class="value"> <span class="value">
<template is="dom-repeat" items="[[change.hashtags]]"> <template is="dom-repeat" items="[[change.hashtags]]">
<gr-linked-chip <gr-linked-chip
class="hashtagChip"
text="[[item]]" text="[[item]]"
href="[[_computeHashtagURL(item)]]" href="[[_computeHashtagURL(item)]]"
removable="[[!_hashtagReadOnly]]" removable="[[!_hashtagReadOnly]]"
@@ -247,6 +252,7 @@ limitations under the License.
</gr-linked-chip> </gr-linked-chip>
</template> </template>
<gr-editable-label <gr-editable-label
uppercase
label-text="Add a hashtag" label-text="Add a hashtag"
value="{{_newHashtag}}" value="{{_newHashtag}}"
placeholder="[[_computeHashtagPlaceholder(_hashtagReadOnly)]]" placeholder="[[_computeHashtagPlaceholder(_hashtagReadOnly)]]"

View File

@@ -14,7 +14,7 @@
(function() { (function() {
'use strict'; 'use strict';
const HASHTAG_ADD_MESSAGE = 'Click to add'; const HASHTAG_ADD_MESSAGE = 'Add Hashtag';
const SubmitTypeLabel = { const SubmitTypeLabel = {
FAST_FORWARD_ONLY: 'Fast Forward Only', FAST_FORWARD_ONLY: 'Fast Forward Only',
@@ -209,7 +209,7 @@
}, },
_computeTopicPlaceholder(_topicReadOnly) { _computeTopicPlaceholder(_topicReadOnly) {
return _topicReadOnly ? 'No Topic' : 'Click to add topic'; return _topicReadOnly ? 'No Topic' : 'Add Topic';
}, },
_computeHashtagPlaceholder(_hashtagReadOnly) { _computeHashtagPlaceholder(_hashtagReadOnly) {

View File

@@ -67,7 +67,7 @@
}, },
_computeDescriptionPlaceholder(readOnly) { _computeDescriptionPlaceholder(readOnly) {
return (readOnly ? 'No' : 'Add a') + ' patch set description'; return (readOnly ? 'No' : 'Add') + ' patchset description';
}, },
_computeDescriptionReadOnly(loggedIn, change, account) { _computeDescriptionReadOnly(loggedIn, change, account) {

View File

@@ -93,9 +93,9 @@ limitations under the License.
test('_computeDescriptionPlaceholder', () => { test('_computeDescriptionPlaceholder', () => {
assert.equal(element._computeDescriptionPlaceholder(true), assert.equal(element._computeDescriptionPlaceholder(true),
'No patch set description'); 'No patchset description');
assert.equal(element._computeDescriptionPlaceholder(false), assert.equal(element._computeDescriptionPlaceholder(false),
'Add a patch set description'); 'Add patchset description');
}); });
test('_computePatchSetDisabled', () => { test('_computePatchSetDisabled', () => {

View File

@@ -127,7 +127,7 @@ limitations under the License.
display: none; display: none;
} }
label.show-hide { label.show-hide {
color: #00f; color: var(--color-link);
cursor: pointer; cursor: pointer;
display: block; display: block;
font-size: .8em; font-size: .8em;

View File

@@ -51,19 +51,24 @@ limitations under the License.
.selectedValueText.hidden { .selectedValueText.hidden {
display: none; display: none;
} }
iron-selector > gr-button:first-of-type {
border-bottom-left-radius: 2px;
border-top-left-radius: 2px;
}
iron-selector > gr-button:last-of-type {
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
}
iron-selector > gr-button.iron-selected {
background-color: #ddd;
}
gr-button { gr-button {
min-width: 40px; min-width: 40px;
--gr-button: {
border: 1px solid #d1d2d3;
border-radius: 12px;
box-shadow: none;
padding: .2em .85em;
}
--gr-button-background: #f5f5f5;
--gr-button-color: black;
--gr-button-hover-color: black;
}
iron-selector > gr-button.iron-selected {
--gr-button-background:#ddd;
--gr-button-color: black;
--gr-button-hover-background-color: #ddd;
--gr-button-hover-color: black;
} }
.placeholder { .placeholder {
display: inline-block; display: inline-block;

View File

@@ -106,6 +106,8 @@
// nothing and then to the new item. // nothing and then to the new item.
if (!e.target.selectedItem) { return; } if (!e.target.selectedItem) { return; }
this._selectedValueText = e.target.selectedItem.getAttribute('title'); this._selectedValueText = e.target.selectedItem.getAttribute('title');
// Needed to update the style of the selected button.
this.updateStyles();
this.fire('labels-changed'); this.fire('labels-changed');
}, },

View File

@@ -86,14 +86,14 @@ limitations under the License.
assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden')); assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden'));
assert.equal(getMessages().length, 20); assert.equal(getMessages().length, 20);
assert.equal(element.$.incrementMessagesBtn.innerText.trim(), assert.equal(element.$.incrementMessagesBtn.innerText.toUpperCase()
'Show 5 more'); .trim(), 'SHOW 5 MORE');
MockInteractions.tap(element.$.incrementMessagesBtn); MockInteractions.tap(element.$.incrementMessagesBtn);
flushAsynchronousOperations(); flushAsynchronousOperations();
assert.equal(getMessages().length, 25); assert.equal(getMessages().length, 25);
assert.equal(element.$.incrementMessagesBtn.innerText.trim(), assert.equal(element.$.incrementMessagesBtn.innerText.toUpperCase()
'Show 1 more'); .trim(), 'SHOW 1 MORE');
MockInteractions.tap(element.$.incrementMessagesBtn); MockInteractions.tap(element.$.incrementMessagesBtn);
flushAsynchronousOperations(); flushAsynchronousOperations();
@@ -108,7 +108,8 @@ limitations under the License.
assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden')); assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden'));
assert.equal(getMessages().length, 20); assert.equal(getMessages().length, 20);
assert.equal(element.$.oldMessagesBtn.innerText, 'Show all 6 messages'); assert.equal(element.$.oldMessagesBtn.innerText.toUpperCase(),
'SHOW ALL 6 MESSAGES');
MockInteractions.tap(element.$.oldMessagesBtn); MockInteractions.tap(element.$.oldMessagesBtn);
flushAsynchronousOperations(); flushAsynchronousOperations();
@@ -121,7 +122,8 @@ limitations under the License.
.concat(_.times(11, randomMessage)); .concat(_.times(11, randomMessage));
flushAsynchronousOperations(); flushAsynchronousOperations();
assert.equal(element.$.oldMessagesBtn.innerText, 'Show 1 message'); assert.equal(element.$.oldMessagesBtn.innerText.toUpperCase(),
'SHOW 1 MESSAGE');
assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden')); assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden'));
MockInteractions.tap(element.$.automatedMessageToggle); MockInteractions.tap(element.$.automatedMessageToggle);
flushAsynchronousOperations(); flushAsynchronousOperations();
@@ -134,12 +136,14 @@ limitations under the License.
.concat(_.times(11, randomAutomated)); .concat(_.times(11, randomAutomated));
flushAsynchronousOperations(); flushAsynchronousOperations();
assert.equal(element.$.oldMessagesBtn.innerText, 'Show 1 message'); assert.equal(element.$.oldMessagesBtn.innerText.toUpperCase(),
'SHOW 1 MESSAGE');
assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden')); assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden'));
MockInteractions.tap(element.$.automatedMessageToggle); MockInteractions.tap(element.$.automatedMessageToggle);
flushAsynchronousOperations(); flushAsynchronousOperations();
assert.equal(element.$.oldMessagesBtn.innerText, 'Show 1 message'); assert.equal(element.$.oldMessagesBtn.innerText.toUpperCase(),
'SHOW 1 MESSAGE');
assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden')); assert.isFalse(element.$.messageControlsContainer.hasAttribute('hidden'));
}); });

View File

@@ -117,10 +117,6 @@ limitations under the License.
.draftsContainer h3 { .draftsContainer h3 {
margin-top: .25em; margin-top: .25em;
} }
.action:link,
.action:visited {
color: #00e;
}
#checkingStatusLabel, #checkingStatusLabel,
#notLatestLabel { #notLatestLabel {
margin-left: 1em; margin-left: 1em;

View File

@@ -67,7 +67,9 @@ limitations under the License.
.linksTitle { .linksTitle {
color: var(--primary-text-color); color: var(--primary-text-color);
display: inline-block; display: inline-block;
font-family: var(--font-family-bold);
position: relative; position: relative;
text-transform: uppercase;
} }
.linksTitle:hover { .linksTitle:hover {
opacity: .75; opacity: .75;
@@ -157,7 +159,9 @@ limitations under the License.
</li> </li>
</template> </template>
<li> <li>
<a class="browse linksTitle" href$="[[_computeRelativeURL('/admin/projects')]]"> <a
class="browse linksTitle"
href$="[[_computeRelativeURL('/admin/projects')]]">
Browse</a> Browse</a>
</li> </li>
</ul> </ul>

View File

@@ -85,7 +85,6 @@ limitations under the License.
vertical-align: middle; vertical-align: middle;
} }
.dropdown-trigger { .dropdown-trigger {
color: #00e;
cursor: pointer; cursor: pointer;
padding: 0; padding: 0;
} }
@@ -111,7 +110,7 @@ limitations under the License.
width: .3em; width: .3em;
} }
.dropdown-content a:hover { .dropdown-content a:hover {
background-color: #00e; background-color: var(--color-link);
color: #fff; color: #fff;
} }
.dropdown-content a[selected] { .dropdown-content a[selected] {
@@ -125,7 +124,6 @@ limitations under the License.
color: #000; color: #000;
} }
gr-button { gr-button {
font: inherit;
padding: .3em 0; padding: .3em 0;
text-decoration: none; text-decoration: none;
} }

View File

@@ -60,7 +60,7 @@ limitations under the License.
color: #219; color: #219;
} }
.gr-syntax-type { .gr-syntax-type {
color: #00f; color: var(--color-link);
} }
.gr-syntax-title { .gr-syntax-title {
color: #0000C0; color: #0000C0;

View File

@@ -59,18 +59,21 @@ limitations under the License.
<td class="urlCell">[[item.url]]</td> <td class="urlCell">[[item.url]]</td>
<td class="buttonColumn"> <td class="buttonColumn">
<gr-button <gr-button
link
data-index="[[index]]" data-index="[[index]]"
on-tap="_handleMoveUpButton" on-tap="_handleMoveUpButton"
class="moveUpButton"></gr-button> class="moveUpButton"></gr-button>
</td> </td>
<td class="buttonColumn"> <td class="buttonColumn">
<gr-button <gr-button
link
data-index="[[index]]" data-index="[[index]]"
on-tap="_handleMoveDownButton" on-tap="_handleMoveDownButton"
class="moveDownButton"></gr-button> class="moveDownButton"></gr-button>
</td> </td>
<td> <td>
<gr-button <gr-button
link
data-index="[[index]]" data-index="[[index]]"
on-tap="_handleDeleteButton" on-tap="_handleDeleteButton"
class="remove-button">Delete</gr-button> class="remove-button">Delete</gr-button>
@@ -99,6 +102,7 @@ limitations under the License.
<th></th> <th></th>
<th> <th>
<gr-button <gr-button
link
disabled$="[[_computeAddDisabled(_newName, _newUrl)]]" disabled$="[[_computeAddDisabled(_newName, _newUrl)]]"
on-tap="_handleAddButton">Add</gr-button> on-tap="_handleAddButton">Add</gr-button>
</th> </th>

View File

@@ -353,6 +353,7 @@ limitations under the License.
id="emailEditor" id="emailEditor"
has-unsaved-changes="{{_emailsChanged}}"></gr-email-editor> has-unsaved-changes="{{_emailsChanged}}"></gr-email-editor>
<gr-button <gr-button
link
on-tap="_handleSaveEmails" on-tap="_handleSaveEmails"
disabled$="[[!_emailsChanged]]">Save changes</gr-button> disabled$="[[!_emailsChanged]]">Save changes</gr-button>
</fieldset> </fieldset>

View File

@@ -83,6 +83,7 @@ limitations under the License.
</template> </template>
<td> <td>
<gr-button <gr-button
link
data-index$="[[projectIndex]]" data-index$="[[projectIndex]]"
on-tap="_handleRemoveProject">Delete</gr-button> on-tap="_handleRemoveProject">Delete</gr-button>
</td> </td>
@@ -106,7 +107,7 @@ limitations under the License.
placeholder="branch:name, or other search expression"> placeholder="branch:name, or other search expression">
</th> </th>
<th> <th>
<gr-button on-tap="_handleAddProject">Add</gr-button> <gr-button link on-tap="_handleAddProject">Add</gr-button>
</th> </th>
</tr> </tr>
</tfoot> </tfoot>

View File

@@ -37,14 +37,14 @@ limitations under the License.
:host([show-avatar]) .container { :host([show-avatar]) .container {
padding-left: 0; padding-left: 0;
} }
gr-button.remove,
gr-button.remove:hover, gr-button.remove:hover,
gr-button.remove:focus { gr-button.remove:focus {
border-color: transparent; --gr-button: {
color: #333; color: #333;
} }
}
gr-button.remove { gr-button.remove {
background: #eee; --gr-button: {
border: 0; border: 0;
color: #666; color: #666;
font-size: 1.7em; font-size: 1.7em;
@@ -56,6 +56,13 @@ limitations under the License.
padding: 0; padding: 0;
text-decoration: none; text-decoration: none;
} }
--gr-button-hover-color: {
color: #333;
}
--gr-button-hover-background-color: {
color: #333;
}
}
:host:focus { :host:focus {
border-color: transparent; border-color: transparent;
box-shadow: none; box-shadow: none;
@@ -78,6 +85,7 @@ limitations under the License.
<gr-account-link account="[[account]]"></gr-account-link> <gr-account-link account="[[account]]"></gr-account-link>
<gr-button <gr-button
id="remove" id="remove"
link
hidden$="[[!removable]]" hidden$="[[!removable]]"
hidden hidden
tabindex="-1" tabindex="-1"

View File

@@ -18,122 +18,100 @@ limitations under the License.
<link rel="import" href="../../../behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html"> <link rel="import" href="../../../behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html">
<link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html"> <link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html">
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../../styles/shared-styles.html"> <link rel="import" href="../../../styles/shared-styles.html">
<dom-module id="gr-button"> <dom-module id="gr-button">
<template strip-whitespace> <template strip-whitespace>
<style include="shared-styles"> <style include="shared-styles">
:host { :host {
background-color: #f5f5f5;
border: 1px solid #d1d2d3;
border-radius: 2px;
box-sizing: border-box;
color: #333;
cursor: pointer;
display: inline-block; display: inline-block;
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
font-size: 12px; font-size: 12px;
outline-width: 0;
padding: .4em .85em;
position: relative; position: relative;
text-align: center;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
} }
:host([hidden]) { :host([hidden]) {
display: none; display: none;
} }
:host([primary]),
:host([secondary]) {
color: #fff;
}
:host([primary]) {
background-color: #4d90fe;
border-color: #3079ed;
}
:host([secondary]) {
background-color: #d14836;
border-color: transparent;
}
:host([small]) {
font-size: 12px;
}
:host([link]) { :host([link]) {
background-color: transparent; background-color: transparent;
border: none; border: none;
color: #00f; color: var(--color-link);
font-size: inherit; font-size: inherit;
font-family: var(--font-family); font-family: var(--font-family-bold);
padding: 0; text-transform: none;
text-decoration: underline;
} }
:host([loading]), :host([link]) paper-button {
:host([disabled]) { margin: 0;
padding: 0;
@apply --gr-button;
}
paper-button[raised] {
background-color: var(--gr-button-background, #fff);
color: var(--gr-button-color, --color-link);
}
/* todo (beckysiegel) switch all secondary to primary as there is no color
distinction anymore. */
:host([primary]) paper-button[raised],
:host([secondary]) paper-button[raised] {
background-color: var(--color-link);
color: #fff;
}
:host([link]) paper-button:hover,
:host([link]) paper-button:focus,
paper-button[raised]:hover,
paper-button[raised]:focus {
color: var(--gr-button-hover-color, --color-button-hover);
}
:host([primary]) paper-button[raised]:hover,
:host([primary]) paper-button[raised]:focus,
:host([secondary]) paper-button[raised]:hover,
:host([secondary]) paper-button[raised]:focus {
background-color: var(--gr-button-hover-background-color, --color-button-hover);
color: var(--gr-button-color, #fff);
}
paper-button,
paper-button[raised],
paper-button[link] {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
min-width: 0;
padding: .4em .85em;
@apply --gr-button;
}
:host([link]) paper-button {
--paper-button: {
padding: 0;
}
}
:host:not([down-arrow]) .downArrow {display: none; }
:host([down-arrow]) .downArrow {
border-left: .36em solid transparent;
border-right: .36em solid transparent;
border-top: .36em solid #ccc;
margin-left: .5em;
transition: border-top-color 200ms;
}
:host([down-arrow]):hover .downArrow {
border-top-color: #666;
}
:host([loading]) paper-button,
:host([disabled]) paper-button {
color: #aaa;
}
:host([loading]) paper-button,
:host([loading][disabled]) paper-button {
cursor: wait;
background-color: #efefef; background-color: #efefef;
color: #aaa; color: #aaa;
} }
:host([disabled]) {
cursor: default;
}
:host([loading]),
:host([loading][disabled]) {
cursor: wait;
}
:host:focus:not([link]),
:host:hover:not([link]) {
background-color: #f8f8f8;
border-color: #aaa;
}
:host(:active) {
border-color: #d1d2d3;
color: #aaa;
}
:host([primary]:focus),
:host([secondary]:focus),
:host([primary]:active),
:host([secondary]:active) {
color: #fff;
}
:host([primary]:focus) {
box-shadow: 0 0 1px #00f;
background-color: #4d90fe;
}
:host([primary]:not([disabled]):hover) {
background-color: #4d90fe;
border-color: #00F;
}
:host([primary]:active),
:host([secondary]:active) {
box-shadow: none;
}
:host([primary]:active) {
border-color: #0c2188;
}
:host([secondary]:focus) {
box-shadow: 0 0 1px #f00;
background-color: #d14836;
}
:host([secondary]:not([disabled]):hover) {
background-color: #c53727;
border: 1px solid #b0281a;
}
:host([secondary]:active) {
border-color: #941c0c;
}
:host([primary][loading]) {
background-color: #7caeff;
border-color: transparent;
color: #fff;
}
:host([primary][disabled]) {
background-color: #4d90fe;
color: #fff;
opacity: .5;
}
</style> </style>
<paper-button raised="[[!link]]">
<content></content> <content></content>
<i class="downArrow"></i>
</paper-button>
</template> </template>
<script src="gr-button.js"></script> <script src="gr-button.js"></script>
</dom-module> </dom-module>

View File

@@ -18,8 +18,13 @@
is: 'gr-button', is: 'gr-button',
properties: { properties: {
downArrow: {
type: Boolean,
reflectToAttribute: true,
},
link: { link: {
type: Boolean, type: Boolean,
value: false,
reflectToAttribute: true, reflectToAttribute: true,
}, },
disabled: { disabled: {

View File

@@ -43,9 +43,6 @@ limitations under the License.
font: inherit; font: inherit;
padding: .3em 0; padding: .3em 0;
} }
:host([down-arrow]) .dropdown-trigger {
padding-right: 1.4em;
}
gr-avatar { gr-avatar {
height: 2em; height: 2em;
width: 2em; width: 2em;
@@ -75,7 +72,6 @@ limitations under the License.
} }
li .itemAction:link, li .itemAction:link,
li .itemAction:visited { li .itemAction:visited {
color: #00e;
text-decoration: none; text-decoration: none;
} }
li .itemAction:not(.disabled):hover { li .itemAction:not(.disabled):hover {
@@ -94,26 +90,13 @@ limitations under the License.
.bold-text { .bold-text {
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
} }
:host:not([down-arrow]) .downArrow { display: none; }
:host([down-arrow]) .downArrow {
border-left: .36em solid transparent;
border-right: .36em solid transparent;
border-top: .36em solid #ccc;
height: 0;
position: absolute;
right: .3em;
top: calc(50% - .05em);
transition: border-top-color 200ms;
width: 0;
}
.dropdown-trigger:hover .downArrow {
border-top-color: #666;
}
</style> </style>
<gr-button link="[[link]]" class="dropdown-trigger" id="trigger" <gr-button
link="[[link]]"
class="dropdown-trigger" id="trigger"
down-arrow="[[downArrow]]"
on-tap="_showDropdownTapHandler"> on-tap="_showDropdownTapHandler">
<content></content> <content></content>
<i class="downArrow"></i>
</gr-button> </gr-button>
<iron-dropdown id="dropdown" <iron-dropdown id="dropdown"
vertical-align="top" vertical-align="top"

View File

@@ -37,6 +37,7 @@
type: Array, type: Array,
observer: '_resetCursorStops', observer: '_resetCursorStops',
}, },
downArrow: Boolean,
topContent: Object, topContent: Object,
horizontalAlign: { horizontalAlign: {
type: String, type: String,

View File

@@ -27,6 +27,9 @@ limitations under the License.
align-items: center; align-items: center;
display: inline-flex; display: inline-flex;
} }
:host([uppercase]) label {
text-transform: uppercase;
}
input, input,
label { label {
width: 100%; width: 100%;
@@ -37,14 +40,14 @@ limitations under the License.
label { label {
color: #777; color: #777;
display: inline-block; display: inline-block;
font-family: var(--font-family-bold);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
label.editable { label.editable {
color: #00f; color: var(--color-link);
cursor: pointer; cursor: pointer;
text-decoration: underline;
} }
#dropdown { #dropdown {
box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px; box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px;

View File

@@ -46,6 +46,11 @@
type: Boolean, type: Boolean,
value: false, value: false,
}, },
uppercase: {
type: Boolean,
reflectToAttribute: true,
value: false,
},
_inputText: String, _inputText: String,
// This is used to push the iron-input element up on the page, so // This is used to push the iron-input element up on the page, so
// the input is placed in approximately the same position as the // the input is placed in approximately the same position as the

View File

@@ -34,14 +34,14 @@ limitations under the License.
display: inline-flex; display: inline-flex;
padding: 0 .5em; padding: 0 .5em;
} }
gr-button.remove,
gr-button.remove:hover, gr-button.remove:hover,
gr-button.remove:focus { gr-button.remove:focus {
border-color: transparent; --gr-button: {
color: #333; color: #333;
} }
}
gr-button.remove { gr-button.remove {
background: #eee; --gr-button: {
border: 0; border: 0;
color: #666; color: #666;
font-size: 1.7em; font-size: 1.7em;
@@ -53,6 +53,13 @@ limitations under the License.
padding: 0; padding: 0;
text-decoration: none; text-decoration: none;
} }
--gr-button-hover-color: {
color: #333;
}
--gr-button-hover-background-color: {
color: #333;
}
}
.transparentBackground, .transparentBackground,
gr-button.transparentBackground { gr-button.transparentBackground {
background-color: transparent; background-color: transparent;
@@ -68,6 +75,7 @@ limitations under the License.
</a> </a>
<gr-button <gr-button
id="remove" id="remove"
link
hidden$="[[!removable]]" hidden$="[[!removable]]"
hidden hidden
class$="remove [[_getBackgroundClass(transparentBackground)]]" class$="remove [[_getBackgroundClass(transparentBackground)]]"

View File

@@ -35,6 +35,11 @@ limitations under the License.
--iron-overlay-backdrop: { --iron-overlay-backdrop: {
transition: none; transition: none;
} }
/* Follow are a part of the design refresh */
--color-link: #2a66d9;
/* 12% darker */
--color-button-hover: #0B47BA;
} }
@media screen and (max-width: 50em) { @media screen and (max-width: 50em) {
:root { :root {

View File

@@ -38,6 +38,9 @@ limitations under the License.
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
a {
color: var(--color-link);
}
input, input,
textarea, textarea,
select, select,