Replace more CSS vars with constants

Swaps out various shades of red and black with --error-text-color and
--deemphasized-text-color, respectively.

Also removes some vestigial CSS that was never applied, and a hard-coded
check for a specific color in gr-autocomplete_test.

Change-Id: Ideee67300d8bbaa8e86fb1a2991492fa22a2ac43
This commit is contained in:
Kasper Nilsson 2018-05-09 20:18:20 -07:00
parent be341b5c42
commit 4313467582
14 changed files with 13 additions and 24 deletions

View File

@ -32,7 +32,7 @@ limitations under the License.
<style include="shared-styles"></style> <style include="shared-styles"></style>
<style include="gr-subpage-styles"> <style include="gr-subpage-styles">
h3.edited:after { h3.edited:after {
color: #444; color: var(--deemphasized-text-color);
content: ' *'; content: ' *';
} }
.inputUpdateBtn { .inputUpdateBtn {

View File

@ -33,7 +33,7 @@ limitations under the License.
<style="shared-styles"></style> <style="shared-styles"></style>
<style include="gr-subpage-styles"> <style include="gr-subpage-styles">
h2.edited:after { h2.edited:after {
color: #444; color: var(--deemphasized-text-color);
content: ' *'; content: ' *';
} }
.loading, .loading,

View File

@ -178,7 +178,7 @@ limitations under the License.
display: none; display: none;
} }
.warning { .warning {
color: #d14836; color: var(--error-text-color);
} }
hr { hr {
border: 0; border: 0;

View File

@ -55,7 +55,7 @@ limitations under the License.
width: 100%; width: 100%;
} }
.warning { .warning {
color: red; color: var(--error-text-color);
} }
</style> </style>
<gr-confirm-dialog <gr-confirm-dialog

View File

@ -122,7 +122,7 @@ limitations under the License.
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.oldPath { .oldPath {
color: #999; color: var(--deemphasized-text-color);
} }
.comments, .comments,
.stats { .stats {

View File

@ -49,12 +49,6 @@ limitations under the License.
gr-account-chip { gr-account-chip {
margin-top: .3em; margin-top: .3em;
} }
.remove {
color: #999;
}
.remove {
font-size: var(--font-size-small);
}
gr-button { gr-button {
--gr-button: { --gr-button: {
padding-left: 0; padding-left: 0;

View File

@ -212,7 +212,6 @@ limitations under the License.
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
gr-confirm-dialog .main { gr-confirm-dialog .main {
background-color: #fef;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;

View File

@ -77,7 +77,7 @@ limitations under the License.
} }
.navLink:not([href]), .navLink:not([href]),
.downloadLink:not([href]) { .downloadLink:not([href]) {
color: #999; color: var(--deemphasized-text-color);
} }
.navLinks { .navLinks {
align-items: center; align-items: center;
@ -189,7 +189,7 @@ limitations under the License.
text-decoration: none; text-decoration: none;
} }
.mobileNavLink:not([href]) { .mobileNavLink:not([href]) {
color: #bbb; color: var(--deemphasized-text-color);
} }
.jumpToFileContainer { .jumpToFileContainer {
display: block; display: block;

View File

@ -127,10 +127,10 @@ limitations under the License.
font-size: 1.2rem; font-size: 1.2rem;
} }
.errorMoreInfo { .errorMoreInfo {
color: #999; color: var(--deemphasized-text-color);
} }
.feedback { .feedback {
color: #b71c1c; color: var(--error-text-color);
} }
</style> </style>
<gr-fixed-panel id="header"> <gr-fixed-panel id="header">

View File

@ -52,7 +52,7 @@ limitations under the License.
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
} }
.alreadySubmittedText { .alreadySubmittedText {
color: red; color: var(--error-text-color);
margin: 0 2em; margin: 0 2em;
padding: .5em; padding: .5em;
} }

View File

@ -59,7 +59,7 @@ limitations under the License.
} }
paper-input.warnUncommitted { paper-input.warnUncommitted {
--paper-input-container-input: { --paper-input-container-input: {
color: #ff0000; color: var(--error-text-color);
font-size: var(--font-size-normal); font-size: var(--font-size-normal);
} }
} }

View File

@ -507,12 +507,8 @@ limitations under the License.
element.text = 'blah blah blah'; element.text = 'blah blah blah';
MockInteractions.blur(element.$.input); MockInteractions.blur(element.$.input);
assert.isTrue(inputClassList.contains('warnUncommitted')); assert.isTrue(inputClassList.contains('warnUncommitted'));
assert.equal(getComputedStyle(element.$.input.inputElement).color,
'rgb(255, 0, 0)');
MockInteractions.focus(element.$.input); MockInteractions.focus(element.$.input);
assert.isFalse(inputClassList.contains('warnUncommitted')); assert.isFalse(inputClassList.contains('warnUncommitted'));
assert.notEqual(getComputedStyle(element.$.input.inputElement).color,
'rgb(255, 0, 0)ed');
}); });
test('disabled', () => { test('disabled', () => {

View File

@ -69,7 +69,7 @@ limitations under the License.
@apply --gr-dropdown-item; @apply --gr-dropdown-item;
} }
li .itemAction.disabled { li .itemAction.disabled {
color: #ccc; color: var(--deemphasized-text-color);
cursor: default; cursor: default;
} }
li .itemAction:link, li .itemAction:link,

View File

@ -37,7 +37,7 @@ limitations under the License.
max-width: none; max-width: none;
} }
h2.edited:after { h2.edited:after {
color: #444; color: var(--deemphasized-text-color);
content: ' *'; content: ' *';
} }
.loading { .loading {