Redesign tootbox (#5919)

* Redesign tootbox

* Move counter into compose-form__buttons-wrapper

Change font and remove shadow
Refactor sass codes of compose-form
th-downstream
Lynx Kotoura 7 years ago committed by Eugen Rochko
parent d4d0befb4b
commit d7bd1906d4

@ -199,11 +199,11 @@ 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>
); );

@ -265,198 +265,286 @@
.compose-form { .compose-form {
padding: 10px; padding: 10px;
}
.compose-form__warning {
color: darken($ui-secondary-color, 65%);
margin-bottom: 15px;
background: $ui-primary-color;
box-shadow: 0 2px 6px rgba($base-shadow-color, 0.3);
padding: 8px 10px;
border-radius: 4px;
font-size: 13px;
font-weight: 400;
strong { .compose-form__warning {
color: darken($ui-secondary-color, 65%); color: darken($ui-secondary-color, 65%);
font-weight: 500; margin-bottom: 15px;
background: $ui-primary-color;
box-shadow: 0 2px 6px rgba($base-shadow-color, 0.3);
padding: 8px 10px;
border-radius: 4px;
font-size: 13px;
font-weight: 400;
@each $lang in $cjk-langs { strong {
&:lang(#{$lang}) { color: darken($ui-secondary-color, 65%);
font-weight: 700; font-weight: 500;
@each $lang in $cjk-langs {
&:lang(#{$lang}) {
font-weight: 700;
}
}
}
a {
color: darken($ui-primary-color, 33%);
font-weight: 500;
text-decoration: underline;
&:hover,
&:active,
&:focus {
text-decoration: none;
} }
} }
} }
a { .compose-form__autosuggest-wrapper {
color: darken($ui-primary-color, 33%); position: relative;
font-weight: 500;
text-decoration: underline; .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;
&:hover,
&:active,
&:focus { &:focus {
text-decoration: none; outline: 0;
}
@media screen and (max-width: 600px) {
font-size: 16px;
} }
} }
}
.compose-form__modifiers { .spoiler-input__input {
color: $ui-base-color; border-radius: 4px;
font-family: inherit; }
font-size: 14px;
background: $simple-background-color;
border-radius: 0 0 4px;
}
.compose-form__buttons-wrapper { .autosuggest-textarea__textarea {
display: flex; min-height: 100px;
justify-content: space-between; border-radius: 4px 4px 0 0;
} padding-bottom: 0;
padding-right: 10px + 22px;
resize: none;
.compose-form__buttons { @media screen and (max-width: 600px) {
padding: 10px; height: 100px !important; // prevent auto-resize textarea
background: darken($simple-background-color, 8%); resize: vertical;
box-shadow: inset 0 5px 5px rgba($base-shadow-color, 0.05); }
border-radius: 0 0 4px 4px; }
display: flex;
.icon-button { .autosuggest-textarea__suggestions {
box-sizing: content-box; box-sizing: border-box;
padding: 0 3px; 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;
}
} }
}
.compose-form__upload-button-icon { .autosuggest-textarea__suggestions__item {
line-height: 27px; padding: 10px;
} cursor: pointer;
border-radius: 4px;
.compose-form__sensitive-button { &:hover,
display: none; &: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;
}
&.compose-form__sensitive-button--visible { .autosuggest-account-icon,
.autosuggest-emoji img {
display: block; display: block;
margin-right: 8px;
width: 16px;
height: 16px;
} }
.compose-form__sensitive-button__icon { .autosuggest-account .display-name__account {
line-height: 27px; color: lighten($ui-base-color, 36%);
} }
}
.compose-form__upload-wrapper { .compose-form__modifiers {
overflow: hidden; color: $ui-base-color;
} font-family: inherit;
font-size: 14px;
background: $simple-background-color;
.compose-form__uploads-wrapper { .compose-form__upload-wrapper {
display: flex; overflow: hidden;
flex-direction: row; }
padding: 5px;
flex-wrap: wrap;
}
.compose-form__upload { .compose-form__uploads-wrapper {
flex: 1 1 0; display: flex;
min-width: 40%; flex-direction: row;
margin: 5px; padding: 5px;
flex-wrap: wrap;
}
&-description { .compose-form__upload {
position: absolute; flex: 1 1 0;
z-index: 2; min-width: 40%;
bottom: 0; margin: 5px;
left: 0;
right: 0;
box-sizing: border-box;
background: linear-gradient(0deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent);
padding: 10px;
opacity: 0;
transition: opacity .1s ease;
input { &-description {
background: transparent; position: absolute;
color: $ui-secondary-color; z-index: 2;
border: 0; bottom: 0;
padding: 0; left: 0;
margin: 0; right: 0;
width: 100%; box-sizing: border-box;
font-family: inherit; background: linear-gradient(0deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent);
font-size: 14px; padding: 10px;
font-weight: 500; opacity: 0;
transition: opacity .1s ease;
input {
background: transparent;
color: $ui-secondary-color;
border: 0;
padding: 0;
margin: 0;
width: 100%;
font-family: inherit;
font-size: 14px;
font-weight: 500;
&:focus {
color: $white;
}
&:focus { &::placeholder {
color: $white; opacity: 0.54;
color: $ui-secondary-color;
}
}
&.active {
opacity: 1;
}
} }
&::placeholder { .icon-button {
opacity: 0.54; mix-blend-mode: difference;
color: $ui-secondary-color;
} }
} }
&.active { .compose-form__upload-thumbnail {
opacity: 1; border-radius: 4px;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
height: 100px;
width: 100%;
} }
} }
.icon-button { .compose-form__buttons-wrapper {
mix-blend-mode: difference; padding: 10px;
} background: darken($simple-background-color, 8%);
} border-radius: 0 0 4px 4px;
display: flex;
justify-content: space-between;
.compose-form__upload-thumbnail { .compose-form__buttons {
border-radius: 4px; display: flex;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
height: 100px;
width: 100%;
}
.compose-form__label { .compose-form__upload-button-icon {
display: block; line-height: 27px;
line-height: 24px; }
vertical-align: middle;
&.with-border { .compose-form__sensitive-button {
border-top: 1px solid $ui-base-color; display: none;
padding-top: 10px;
}
.compose-form__label__text { &.compose-form__sensitive-button--visible {
display: inline-block; display: block;
vertical-align: middle; }
margin-bottom: 14px;
margin-left: 8px;
color: $ui-primary-color;
}
}
.compose-form__textarea, .compose-form__sensitive-button__icon {
.follow-form__input { line-height: 27px;
background: $simple-background-color; }
}
}
&:disabled { .icon-button {
background: $ui-secondary-color; box-sizing: content-box;
} padding: 0 3px;
} }
.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;
min-width: 0; justify-content: flex-end;
} 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 {
@ -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;

Loading…
Cancel
Save