Redesign tootbox (#5919)

* Redesign tootbox

* Move counter into compose-form__buttons-wrapper

Change font and remove shadow
Refactor sass codes of compose-form
This commit is contained in:
Lynx Kotoura 2017-12-14 01:37:23 +09:00 committed by Eugen Rochko
parent fef6625496
commit 0aeec0390b
2 changed files with 261 additions and 288 deletions

View File

@ -199,13 +199,13 @@ export default class ComposeForm extends ImmutablePureComponent {
<SensitiveButtonContainer /> <SensitiveButtonContainer />
<SpoilerButtonContainer /> <SpoilerButtonContainer />
</div> </div>
<div className='character-counter__wrapper'><CharacterCounter max={500} text={text} /></div>
</div>
<div className='compose-form__publish'> <div className='compose-form__publish'>
<div className='character-counter__wrapper'><CharacterCounter max={500} text={text} /></div>
<div className='compose-form__publish-button-wrapper'><Button text={publishText} onClick={this.handleSubmit} disabled={disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0)} block /></div> <div className='compose-form__publish-button-wrapper'><Button text={publishText} onClick={this.handleSubmit} disabled={disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0)} block /></div>
</div> </div>
</div> </div>
</div>
); );
} }

View File

@ -265,7 +265,6 @@
.compose-form { .compose-form {
padding: 10px; padding: 10px;
}
.compose-form__warning { .compose-form__warning {
color: darken($ui-secondary-color, 65%); color: darken($ui-secondary-color, 65%);
@ -301,47 +300,121 @@
} }
} }
.compose-form__autosuggest-wrapper {
position: relative;
.emoji-picker-dropdown {
position: absolute;
right: 5px;
top: 5px;
}
}
.autosuggest-textarea,
.spoiler-input {
position: relative;
}
.autosuggest-textarea__textarea,
.spoiler-input__input {
display: block;
box-sizing: border-box;
width: 100%;
margin: 0;
color: $ui-base-color;
background: $simple-background-color;
padding: 10px;
font-family: inherit;
font-size: 14px;
resize: vertical;
border: 0;
outline: 0;
&:focus {
outline: 0;
}
@media screen and (max-width: 600px) {
font-size: 16px;
}
}
.spoiler-input__input {
border-radius: 4px;
}
.autosuggest-textarea__textarea {
min-height: 100px;
border-radius: 4px 4px 0 0;
padding-bottom: 0;
padding-right: 10px + 22px;
resize: none;
@media screen and (max-width: 600px) {
height: 100px !important; // prevent auto-resize textarea
resize: vertical;
}
}
.autosuggest-textarea__suggestions {
box-sizing: border-box;
display: none;
position: absolute;
top: 100%;
width: 100%;
z-index: 99;
box-shadow: 4px 4px 6px rgba($base-shadow-color, 0.4);
background: $ui-secondary-color;
border-radius: 0 0 4px 4px;
color: $ui-base-color;
font-size: 14px;
padding: 6px;
&.autosuggest-textarea__suggestions--visible {
display: block;
}
}
.autosuggest-textarea__suggestions__item {
padding: 10px;
cursor: pointer;
border-radius: 4px;
&:hover,
&:focus,
&:active,
&.selected {
background: darken($ui-secondary-color, 10%);
}
}
.autosuggest-account,
.autosuggest-emoji {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
line-height: 18px;
font-size: 14px;
}
.autosuggest-account-icon,
.autosuggest-emoji img {
display: block;
margin-right: 8px;
width: 16px;
height: 16px;
}
.autosuggest-account .display-name__account {
color: lighten($ui-base-color, 36%);
}
.compose-form__modifiers { .compose-form__modifiers {
color: $ui-base-color; color: $ui-base-color;
font-family: inherit; font-family: inherit;
font-size: 14px; font-size: 14px;
background: $simple-background-color; background: $simple-background-color;
border-radius: 0 0 4px;
}
.compose-form__buttons-wrapper {
display: flex;
justify-content: space-between;
}
.compose-form__buttons {
padding: 10px;
background: darken($simple-background-color, 8%);
box-shadow: inset 0 5px 5px rgba($base-shadow-color, 0.05);
border-radius: 0 0 4px 4px;
display: flex;
.icon-button {
box-sizing: content-box;
padding: 0 3px;
}
}
.compose-form__upload-button-icon {
line-height: 27px;
}
.compose-form__sensitive-button {
display: none;
&.compose-form__sensitive-button--visible {
display: block;
}
.compose-form__sensitive-button__icon {
line-height: 27px;
}
}
.compose-form__upload-wrapper { .compose-form__upload-wrapper {
overflow: hidden; overflow: hidden;
@ -410,54 +483,69 @@
height: 100px; height: 100px;
width: 100%; width: 100%;
} }
}
.compose-form__label { .compose-form__buttons-wrapper {
padding: 10px;
background: darken($simple-background-color, 8%);
border-radius: 0 0 4px 4px;
display: flex;
justify-content: space-between;
.compose-form__buttons {
display: flex;
.compose-form__upload-button-icon {
line-height: 27px;
}
.compose-form__sensitive-button {
display: none;
&.compose-form__sensitive-button--visible {
display: block; display: block;
line-height: 24px;
vertical-align: middle;
&.with-border {
border-top: 1px solid $ui-base-color;
padding-top: 10px;
} }
.compose-form__label__text { .compose-form__sensitive-button__icon {
display: inline-block; line-height: 27px;
vertical-align: middle; }
margin-bottom: 14px;
margin-left: 8px;
color: $ui-primary-color;
} }
} }
.compose-form__textarea, .icon-button {
.follow-form__input { box-sizing: content-box;
background: $simple-background-color; padding: 0 3px;
&:disabled {
background: $ui-secondary-color;
}
} }
.compose-form__autosuggest-wrapper { .character-counter__wrapper {
position: relative; align-self: center;
margin-right: 4px;
.emoji-picker-dropdown { .character-counter {
position: absolute; cursor: default;
right: 5px; font-family: 'mastodon-font-sans-serif', sans-serif;
top: 5px; font-size: 14px;
font-weight: 600;
color: lighten($ui-base-color, 12%);
&.character-counter--over {
color: $warning-red;
}
}
} }
} }
.compose-form__publish { .compose-form__publish {
display: flex; display: flex;
justify-content: flex-end;
min-width: 0; min-width: 0;
}
.compose-form__publish-button-wrapper { .compose-form__publish-button-wrapper {
overflow: hidden; overflow: hidden;
padding-top: 10px; padding-top: 10px;
} }
}
}
.emojione { .emojione {
display: inline-block; display: inline-block;
@ -1973,121 +2061,6 @@
cursor: default; cursor: default;
} }
.autosuggest-textarea,
.spoiler-input {
position: relative;
}
.autosuggest-textarea__textarea,
.spoiler-input__input {
display: block;
box-sizing: border-box;
width: 100%;
margin: 0;
color: $ui-base-color;
background: $simple-background-color;
padding: 10px;
font-family: inherit;
font-size: 14px;
resize: vertical;
border: 0;
outline: 0;
&:focus {
outline: 0;
}
@media screen and (max-width: 600px) {
font-size: 16px;
}
}
.spoiler-input__input {
border-radius: 4px;
}
.autosuggest-textarea__textarea {
min-height: 100px;
border-radius: 4px 4px 0 0;
padding-bottom: 0;
padding-right: 10px + 22px;
resize: none;
@media screen and (max-width: 600px) {
height: 100px !important; // prevent auto-resize textarea
resize: vertical;
}
}
.autosuggest-textarea__suggestions {
box-sizing: border-box;
display: none;
position: absolute;
top: 100%;
width: 100%;
z-index: 99;
box-shadow: 4px 4px 6px rgba($base-shadow-color, 0.4);
background: $ui-secondary-color;
border-radius: 0 0 4px 4px;
color: $ui-base-color;
font-size: 14px;
padding: 6px;
&.autosuggest-textarea__suggestions--visible {
display: block;
}
}
.autosuggest-textarea__suggestions__item {
padding: 10px;
cursor: pointer;
border-radius: 4px;
&:hover,
&:focus,
&:active,
&.selected {
background: darken($ui-secondary-color, 10%);
}
}
.autosuggest-account,
.autosuggest-emoji {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
line-height: 18px;
font-size: 14px;
}
.autosuggest-account-icon,
.autosuggest-emoji img {
display: block;
margin-right: 8px;
width: 16px;
height: 16px;
}
.autosuggest-account .display-name__account {
color: lighten($ui-base-color, 36%);
}
.character-counter__wrapper {
line-height: 36px;
margin: 0 16px 0 8px;
padding-top: 10px;
}
.character-counter {
cursor: default;
font-size: 16px;
}
.character-counter--over {
color: $warning-red;
}
.getting-started__wrapper { .getting-started__wrapper {
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;