Merge "Rework whitespace usage for related changes"

This commit is contained in:
Kasper Nilsson
2018-06-19 19:46:57 +00:00
committed by Gerrit Code Review
5 changed files with 29 additions and 37 deletions

View File

@@ -40,20 +40,28 @@ limitations under the License.
<template> <template>
<style include="gr-voting-styles"></style> <style include="gr-voting-styles"></style>
<style include="shared-styles"> <style include="shared-styles">
.hideDisplay { :host {
display: none; display: table;
}
section {
display: table-row;
}
section:not(:first-of-type) .title,
section:not(:first-of-type) .value {
padding-top: .5em;
} }
section:not(:first-of-type) { section:not(:first-of-type) {
margin-top: 1em; margin-top: 1em;
} }
.title, .title,
.value { .value {
display: block; display: table-cell;
} }
.title { .title {
color: var(--deemphasized-text-color); color: var(--deemphasized-text-color);
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
max-width: 20em; max-width: 20em;
padding-right: .5em;
word-break: break-word; word-break: break-word;
} }
gr-account-link { gr-account-link {
@@ -126,6 +134,7 @@ limitations under the License.
.parentList gr-commit-info { .parentList gr-commit-info {
display: inline-block; display: inline-block;
} }
.hideDisplay,
#parentNotCurrentMessage { #parentNotCurrentMessage {
display: none; display: none;
} }
@@ -133,25 +142,6 @@ limitations under the License.
--arrow-color: #ffa62f; --arrow-color: #ffa62f;
display: inline-block; display: inline-block;
} }
@media screen and (max-width: 50em), screen and (min-width: 75em) {
:host {
display: table;
}
section {
display: table-row;
}
section:not(:first-of-type) .title,
section:not(:first-of-type) .value {
padding-top: .5em;
}
.title,
.value {
display: table-cell;
}
.title {
padding-right: .5em;
}
}
</style> </style>
<gr-external-style id="externalStyle" name="change-metadata"> <gr-external-style id="externalStyle" name="change-metadata">
<section> <section>

View File

@@ -116,13 +116,12 @@ limitations under the License.
font-family: var(--font-family); font-family: var(--font-family);
margin-top: 1em; margin-top: 1em;
} }
.changeInfo-column:not(:last-of-type) { .changeInfo-column {
margin-right: 1em; padding: 0 1em;
padding-right: 1em;
} }
.changeMetadata { .changeMetadata {
border-right: 1px solid var(--border-color); border-right: 1px solid var(--border-color);
font-size: .95rem; font-size: var(--font-size-small);
padding: 1em 0; padding: 1em 0;
} }
/* Prevent plugin text from overflowing. */ /* Prevent plugin text from overflowing. */
@@ -191,7 +190,7 @@ limitations under the License.
overflow: hidden; overflow: hidden;
} }
#relatedChanges { #relatedChanges {
font-size: .9rem; font-size: var(--font-size-small);
} }
#relatedChanges.collapsed { #relatedChanges.collapsed {
margin-bottom: 1.1em; margin-bottom: 1.1em;
@@ -255,9 +254,19 @@ limitations under the License.
max-width: var(--commit-message-max-width, 100ch); max-width: var(--commit-message-max-width, 100ch);
} }
} }
#metadata {
padding-right: 1em;
}
/* NOTE: If you update this breakpoint, also update the /* NOTE: If you update this breakpoint, also update the
BREAKPOINT_RELATED_MED in the JS */ BREAKPOINT_RELATED_MED in the JS */
@media screen and (max-width: 60em) { @media screen and (max-width: 75em) {
.relatedChanges {
padding: 0;
}
#relatedChanges {
border-top: 1px solid var(--border-color);
padding-top: 1em;
}
#commitAndRelated { #commitAndRelated {
flex-direction: column; flex-direction: column;
flex-wrap: nowrap; flex-wrap: nowrap;

View File

@@ -32,7 +32,7 @@
// These are the same as the breakpoint set in CSS. Make sure both are changed // These are the same as the breakpoint set in CSS. Make sure both are changed
// together. // together.
const BREAKPOINT_RELATED_SMALL = '50em'; const BREAKPOINT_RELATED_SMALL = '50em';
const BREAKPOINT_RELATED_MED = '60em'; const BREAKPOINT_RELATED_MED = '75em';
// In the event that the related changes medium width calculation is too close // In the event that the related changes medium width calculation is too close
// to zero, provide some height. // to zero, provide some height.

View File

@@ -1321,7 +1321,7 @@ limitations under the License.
sandbox.stub(element, '_getOffsetHeight', () => 50); sandbox.stub(element, '_getOffsetHeight', () => 50);
sandbox.stub(element, '_getLineHeight', () => 12); sandbox.stub(element, '_getLineHeight', () => 12);
sandbox.stub(window, 'matchMedia', () => { sandbox.stub(window, 'matchMedia', () => {
if (window.matchMedia.lastCall.args[0] === '(max-width: 60em)') { if (window.matchMedia.lastCall.args[0] === '(max-width: 75em)') {
return {matches: true}; return {matches: true};
} else { } else {
return {matches: false}; return {matches: false};

View File

@@ -97,16 +97,9 @@ limitations under the License.
.mobile { .mobile {
display: block; display: block;
} }
hr {
border: 0;
border-top: 1px solid var(--border-color);
height: 0;
margin-bottom: 1em;
}
} }
</style> </style>
<div> <div>
<hr class="mobile">
<section class="relatedChanges" hidden$="[[!_relatedResponse.changes.length]]" hidden> <section class="relatedChanges" hidden$="[[!_relatedResponse.changes.length]]" hidden>
<h4>Relation chain</h4> <h4>Relation chain</h4>
<template <template