REFACTOR: Consistency, A11Y, and less text for composer toggles (#12627)

This commit is contained in:
Kris 2021-04-07 16:15:07 -04:00 committed by GitHub
parent 72ff9e817c
commit ea2105f3e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 24 deletions

View File

@ -2,24 +2,27 @@
{{plugin-outlet name="before-composer-toggles"}}
{{#if site.mobileView}}
{{flat-button
class="toggle-toolbar"
{{d-button
class="btn-flat toggle-toolbar btn-mini-toggle"
icon="bars"
action=toggleToolbar
title=toggleToolbarTitle}}
title=toggleToolbarTitle
ariaLabel=toggleToolbarTitle}}
{{/if}}
{{flat-button
class="toggler"
{{d-button
class="btn-flat toggler toggle-minimize btn-mini-toggle"
icon=toggleIcon
action=toggleComposer
title=toggleTitle}}
title=toggleTitle
ariaLabel=toggleTitle}}
{{#unless site.mobileView}}
{{flat-button
class="toggle-fullscreen"
{{d-button
class="btn-flat toggle-fullscreen btn-mini-toggle"
icon=fullscreenIcon
action=toggleFullscreen
title=fullscreenTitle}}
title=fullscreenTitle
ariaLabel=fullscreenTitle}}
{{/unless}}
</div>

View File

@ -207,7 +207,13 @@
{{d-button action=(action "togglePreview") class="hide-preview" ariaLabel="composer.hide_preview" icon="pencil-alt"}}
{{/if}}
{{else}}
<a href {{action "togglePreview"}} class="toggle-preview">{{html-safe toggleText}}</a>
{{d-button
action=(action "togglePreview")
translatedTitle=toggleText
translatedAriaLabel=toggleText
icon="angle-double-left"
class=(concat "btn-flat btn-mini-toggle toggle-preview " (unless showPreview "active"))
}}
{{/if}}
</div>

View File

@ -83,7 +83,7 @@
.saving-text {
display: none;
}
.toggler {
.toggle-minimize {
order: 2;
}
}
@ -97,9 +97,7 @@
margin: 5px 0 10px 0;
display: flex;
align-items: center;
.d-icon {
color: var(--primary-high);
}
.reply-details {
max-width: calc(100% - 175px);
flex: 1 1 auto;
@ -108,7 +106,7 @@
white-space: nowrap;
.d-icon {
opacity: 0.8;
color: var(--primary-medium);
}
}
.composer-action-title {
@ -152,11 +150,8 @@
.composer-controls {
display: flex;
margin-left: auto;
button {
padding: 5px 7px;
&.toggler {
order: 2;
}
.toggle-minimize {
order: 2;
}
}
}
@ -538,3 +533,10 @@ body:not(.ios-safari-composer-hacks) {
}
}
}
.toggle-preview {
transition: all 0.33s ease-out;
&.active {
transform: rotate(180deg);
}
}

View File

@ -264,6 +264,9 @@
line-height: $line-height-small;
}
// Bonus Buttons
// --------------------------------------------------
.btn-flat {
background: transparent;
border: 0;
@ -309,3 +312,22 @@
padding: 0;
color: var(--tertiary);
}
.btn-mini-toggle {
padding: 0.4em 0.467em;
.d-icon {
color: var(--primary-high);
}
@include hover {
background: transparent;
.d-icon {
color: var(--primary);
}
}
&:focus {
background: var(--primary-low);
.d-icon {
color: var(--primary);
}
}
}

View File

@ -56,7 +56,7 @@
}
}
.toggler {
.toggle-minimize {
.d-icon-chevron-down {
vertical-align: text-top;
}
@ -67,7 +67,7 @@
padding-bottom: env(safe-area-inset-bottom);
.toggle-toolbar,
.toggler {
.toggle-minimize {
top: 8px;
}
.draft-text {

View File

@ -2028,8 +2028,8 @@ en:
saved: "Saved!"
saved_draft: "Post draft in progress. Tap to resume."
uploading: "Uploading..."
show_preview: "show preview &raquo;"
hide_preview: "&laquo; hide preview"
show_preview: "show preview"
hide_preview: "hide preview"
quote_post_title: "Quote whole post"
bold_label: "B"