flatten grid structure of Status.html

This commit is contained in:
Nolan Lawson 2018-02-09 22:01:44 -08:00
parent 8db7d376d4
commit 4a653df3b6
4 changed files with 57 additions and 59 deletions

View File

@ -25,14 +25,14 @@
padding: 10px 20px; padding: 10px 20px;
display: grid; display: grid;
grid-template-areas: grid-template-areas:
"....... header" "....... header header header"
"sidebar author" "sidebar author-name author-handle author-date"
"sidebar spoiler" "sidebar spoiler spoiler spoiler"
"sidebar spoiler-button" "sidebar spoiler-button spoiler-button spoiler-button"
"sidebar content" "sidebar content content content"
"media media" "media media media media"
"....... toolbar"; "....... toolbar toolbar toolbar";
grid-template-columns: 58px 1fr; grid-template-columns: min-content minmax(0, max-content) 1fr min-content;
} }
.status-article.status-in-timeline { .status-article.status-in-timeline {

View File

@ -1,81 +1,73 @@
<div class="status-author {{isStatusInNotification ? 'status-in-notification' : ''}}"> <a
<a class="status-author-name" href="/accounts/{{status.account.id}}"> class="status-author-name {{getClass(isStatusInNotification)}}"
{{status.account.display_name || status.account.username}} href="/accounts/{{status.account.id}}"
</a> >
<span class="status-author-handle"> {{status.account.display_name || status.account.username}}
{{'@' + status.account.acct}} </a>
</span> <span class="status-author-handle {{getClass(isStatusInNotification)}}"
{{#if isStatusInOwnThread}} >
<ExternalLink class="status-author-date" href="{{status.url}}" showIcon="true"> {{'@' + status.account.acct}}
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time> </span>
</ExternalLink> {{#if isStatusInOwnThread}}
{{else}} <ExternalLink class="status-author-date" href="{{status.url}}" showIcon="true">
<a class="status-author-date" href="/statuses/{{status.id}}"> <time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time>
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time> </ExternalLink>
</a> {{else}}
{{/if}} <a class="status-author-date {{getClass(isStatusInNotification)}}"
</div> href="/statuses/{{status.id}}"
>
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time>
</a>
{{/if}}
<style> <style>
.status-author { .status-author {
grid-area: author; grid-area: author;
display: flex;
align-items: center; align-items: center;
margin: 0 10px 0 5px; min-width: 0;
}
.status-author-name {
grid-area: author-name;
align-self: center;
margin-left: 5px;
font-size: 1.1em; font-size: 1.1em;
min-width: 0; min-width: 0;
}
:global(
.status-author a,
.status-author a:visited,
.status-author a:hover,
.status-author
.status-author-handle
) {
color: var(--deemphasized-text-color);
}
:global(.status-author .status-author-name) {
min-width: 0;
flex-shrink: 1;
color: var(--body-text-color);
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
:global(.status-author .status-author-name:hover) { .status-author-name, .status-author-name:hover, .status-author-name:visited {
color: var(--body-text-color); color: var(--body-text-color);
} }
.status-author-handle { .status-author-handle {
min-width: 0; grid-area: author-handle;
flex: 1; align-self: center;
margin-left: 5px; margin-left: 5px;
color: var(--deemphasized-text-color);
font-size: 1.1em;
min-width: 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
:global(.status-author-date) { .status-author-date {
color: var(--deemphasized-text-color); grid-area: author-date;
flex-shrink: 1; align-self: center;
text-align: right;
margin-left: 5px; margin-left: 5px;
margin-right: 10px;
font-size: 1.1em;
text-align: right;
white-space: nowrap; white-space: nowrap;
} }
:global(.status-author-date:hover) { .status-author-date, .status-author-date:hover, .status-author-date:visited {
color: var(--deemphasized-text-color); color: var(--deemphasized-text-color);
} }
:global( .status-author-in-notification, .status-author-in-notification:hover, .status-author-in-notification:visited {
.status-author.status-in-notification,
.status-author.status-in-notification a,
.status-author.status-in-notification a:visited,
.status-author.status-in-notification a:hover,
.status-author.status-in-notification .status-author-handle
) {
color: var(--very-deemphasized-text-color); color: var(--very-deemphasized-text-color);
} }
@ -88,6 +80,9 @@
const relativeFormat = new IntlRelativeFormat('en-US'); const relativeFormat = new IntlRelativeFormat('en-US');
export default { export default {
helpers: {
getClass: isStatusInNotification => isStatusInNotification ? 'status-author-in-notification' : ''
},
computed: { computed: {
createdAtDate: (status) => status.created_at, createdAtDate: (status) => status.created_at,
relativeDate: (createdAtDate) => { relativeDate: (createdAtDate) => {

View File

@ -20,6 +20,9 @@
<style> <style>
.status-header span { .status-header span {
margin-left: 5px; margin-left: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
:global( :global(

View File

@ -4,7 +4,7 @@
<style> <style>
:global(.status-sidebar) { :global(.status-sidebar) {
grid-area: sidebar; grid-area: sidebar;
margin: 0 10px 0 0; margin-right: 10px;
} }
</style> </style>
<script> <script>