mastodon/app/javascript/flavours/glitch/styles/components/compose_form.scss

687 lines
12 KiB
SCSS
Raw Normal View History

.compose-form {
2018-01-13 18:41:20 +00:00
padding: 10px;
2020-01-24 15:17:33 +00:00
.emoji-picker-dropdown {
position: absolute;
top: 0;
inset-inline-end: 0;
2020-01-24 15:17:33 +00:00
::-webkit-scrollbar-track:hover,
::-webkit-scrollbar-track:active {
background-color: rgba($base-overlay-background, 0.3);
}
}
2018-01-13 18:41:20 +00:00
}
.character-counter {
cursor: default;
font-family: $font-sans-serif, sans-serif;
font-size: 14px;
font-weight: 600;
color: $lighter-text-color;
&.character-counter--over {
color: $warning-red;
}
}
.no-reduce-motion .spoiler-input {
transition:
height 0.4s ease,
opacity 0.4s ease;
}
.spoiler-input {
height: 0;
transform-origin: bottom;
opacity: 0;
&.spoiler-input--visible {
height: 36px;
margin-bottom: 11px;
opacity: 1;
}
input {
display: block;
box-sizing: border-box;
margin: 0;
2021-03-06 12:12:35 +00:00
border: 0;
border-radius: 4px;
padding: 10px;
width: 100%;
outline: 0;
color: $inverted-text-color;
background: $simple-background-color;
font-size: 14px;
font-family: inherit;
resize: vertical;
&::placeholder {
color: $dark-text-color;
}
&:focus {
outline: 0;
}
@include single-column('screen and (max-width: 630px)') {
font-size: 16px;
}
}
}
.compose-form__warning {
color: $inverted-text-color;
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;
a {
color: $lighter-text-color;
font-weight: 500;
text-decoration: underline;
&:active,
&:focus,
2021-03-06 12:12:35 +00:00
&:hover {
text-decoration: none;
}
}
}
.compose-form__sensitive-button {
padding: 10px;
padding-top: 0;
font-size: 14px;
font-weight: 500;
&.active {
color: $highlight-text-color;
}
input[type='checkbox'] {
display: none;
}
.checkbox {
display: inline-block;
position: relative;
border: 1px solid $ui-primary-color;
box-sizing: border-box;
width: 18px;
height: 18px;
flex: 0 0 auto;
margin-inline-start: 5px;
margin-inline-end: 10px;
top: -1px;
border-radius: 4px;
vertical-align: middle;
&.active {
border-color: $highlight-text-color;
background: $highlight-text-color
url("data:image/svg+xml;utf8,<svg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M4.5 8.5L8 12l6-6' stroke='white' stroke-width='1.5'/></svg>")
center center no-repeat;
}
}
}
.reply-indicator {
2018-07-27 17:57:24 +00:00
margin: 0 0 10px;
border-radius: 4px;
padding: 10px;
background: $ui-primary-color;
min-height: 23px;
overflow-y: auto;
flex: 0 2 auto;
}
.reply-indicator__header {
margin-bottom: 5px;
overflow: hidden;
& > .account.small {
color: $inverted-text-color;
}
}
.reply-indicator__cancel {
float: right;
line-height: 24px;
}
.reply-indicator__content {
position: relative;
font-size: 14px;
line-height: 20px;
word-wrap: break-word;
font-weight: 400;
overflow: hidden;
padding-top: 5px;
color: $inverted-text-color;
white-space: pre-wrap;
p,
2023-03-05 20:25:48 +00:00
pre {
margin-bottom: 20px;
white-space: pre-wrap;
&:last-child {
margin-bottom: 0;
2019-05-13 13:06:09 +00:00
}
}
2019-05-13 13:06:09 +00:00
a {
color: $lighter-text-color;
text-decoration: none;
&:hover {
text-decoration: underline;
}
&.mention {
&:hover {
text-decoration: none;
span {
text-decoration: underline;
}
}
}
}
2018-01-06 04:04:13 +00:00
.emojione {
width: 20px;
height: 20px;
margin: -5px 0 0;
}
}
2017-12-29 22:55:06 +00:00
.compose-form .compose-form__autosuggest-wrapper {
position: relative;
}
.compose-form .autosuggest-textarea,
.compose-form .autosuggest-input {
position: relative;
width: 100%;
label {
.autosuggest-textarea__textarea {
display: block;
box-sizing: border-box;
margin: 0;
2021-03-06 12:12:35 +00:00
border: 0;
border-radius: 4px 4px 0 0;
padding: 10px 32px 0 10px;
width: 100%;
min-height: 100px;
outline: 0;
color: $inverted-text-color;
background: $simple-background-color;
font-size: 14px;
font-family: inherit;
resize: none;
scrollbar-color: initial;
&::placeholder {
color: $dark-text-color;
}
&::-webkit-scrollbar {
all: unset;
}
2017-12-29 22:55:06 +00:00
2021-03-06 12:12:35 +00:00
&:focus {
outline: 0;
}
@include single-column('screen and (max-width: 630px)') {
font-size: 16px;
}
@include limited-single-column('screen and (max-width: 600px)') {
height: 100px !important; // prevent auto-resize textarea
resize: vertical;
}
}
2017-12-29 22:55:06 +00:00
}
}
2017-12-29 22:55:06 +00:00
.compose-form__textarea-icons {
2018-01-06 02:23:06 +00:00
display: block;
position: absolute;
top: 29px;
inset-inline-end: 5px;
2018-01-06 02:23:06 +00:00
bottom: 5px;
overflow: hidden;
& > .textarea_icon {
display: block;
margin-top: 2px;
margin-inline-start: 2px;
2018-01-06 02:23:06 +00:00
width: 24px;
height: 24px;
color: $lighter-text-color;
2018-01-06 02:23:06 +00:00
font-size: 18px;
line-height: 24px;
text-align: center;
opacity: 0.8;
2018-01-06 02:23:06 +00:00
}
}
.autosuggest-textarea__suggestions-wrapper {
position: relative;
height: 0;
}
.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: $inverted-text-color;
font-size: 14px;
padding: 6px;
}
.autosuggest-textarea__suggestions--visible {
display: block;
}
2017-12-29 22:55:06 +00:00
.autosuggest-textarea__suggestions__item {
padding: 10px;
cursor: pointer;
2019-08-20 20:13:00 +00:00
border-radius: 4px;
2017-12-29 22:55:06 +00:00
&:hover,
&:focus,
&:active,
&.selected {
background: darken($ui-secondary-color, 10%);
}
2019-08-20 20:13:00 +00:00
> .account,
> .emoji,
> .autosuggest-hashtag {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
line-height: 18px;
font-size: 14px;
2017-12-29 22:55:06 +00:00
}
2018-01-06 04:04:13 +00:00
.autosuggest-hashtag {
justify-content: space-between;
&__name {
flex: 1 1 auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
strong {
font-weight: 500;
}
&__uses {
flex: 0 0 auto;
text-align: end;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
2018-01-06 04:04:13 +00:00
& > .account.small {
.display-name {
& > span {
color: $lighter-text-color;
}
2018-01-06 04:04:13 +00:00
}
}
}
2017-12-29 22:55:06 +00:00
.compose-form__upload-wrapper {
overflow: hidden;
}
.compose-form__uploads-wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-family: inherit;
padding: 5px;
overflow: hidden;
}
2017-12-29 22:55:06 +00:00
.compose-form__upload {
flex: 1 1 0;
margin: 5px;
min-width: 40%;
2017-12-29 22:55:06 +00:00
.compose-form__upload-thumbnail {
position: relative;
border-radius: 4px;
height: 140px;
width: 100%;
background-color: $base-shadow-color;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
overflow: hidden;
& > .close {
mix-blend-mode: difference;
}
}
2017-12-29 22:55:06 +00:00
.icon-button {
flex: 0 1 auto;
color: $secondary-text-color;
font-size: 14px;
font-weight: 500;
padding: 10px;
font-family: inherit;
&:hover,
&:focus,
&:active {
color: lighten($secondary-text-color, 7%);
}
}
&__warning {
position: absolute;
z-index: 2;
bottom: 0;
inset-inline-start: 0;
inset-inline-end: 0;
box-sizing: border-box;
background: linear-gradient(
0deg,
rgba($base-shadow-color, 0.8) 0,
rgba($base-shadow-color, 0.35) 80%,
transparent
);
}
}
.compose-form__upload__actions {
background: linear-gradient(
180deg,
rgba($base-shadow-color, 0.8) 0,
rgba($base-shadow-color, 0.35) 80%,
transparent
);
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.upload-progress {
display: flex;
padding: 10px;
color: $darker-text-color;
overflow: hidden;
.fa {
font-size: 34px;
margin-inline-end: 10px;
}
span {
display: block;
font-size: 12px;
font-weight: 500;
text-transform: uppercase;
}
}
.upload-progress__message {
flex: 1 1 auto;
}
.upload-progress__backdrop {
position: relative;
margin-top: 5px;
border-radius: 6px;
width: 100%;
height: 6px;
background: darken($simple-background-color, 8%);
}
.upload-progress__tracker {
position: absolute;
top: 0;
inset-inline-start: 0;
height: 6px;
border-radius: 6px;
background: $ui-highlight-color;
}
.compose-form__modifiers {
color: $inverted-text-color;
font-family: inherit;
font-size: 14px;
background: $simple-background-color;
}
.compose-form__buttons-wrapper {
padding: 10px;
background: darken($simple-background-color, 8%);
border-radius: 0 0 4px 4px;
height: 27px;
display: flex;
justify-content: space-between;
flex: 0 0 auto;
}
.compose-form__buttons {
display: flex;
flex: 0 0 auto;
& .icon-button,
& .text-icon-button {
display: inline-block;
box-sizing: content-box;
padding: 0 3px;
height: 27px;
line-height: 27px;
vertical-align: bottom;
}
2017-12-29 22:55:06 +00:00
& > hr {
display: inline-block;
margin: 0 3px;
border-width: 0 0 0 1px;
border-style: none none none solid;
border-color: transparent transparent transparent
darken($simple-background-color, 24%);
padding: 0;
width: 0;
height: 27px;
background: transparent;
}
}
2017-12-29 22:55:06 +00:00
.character-counter__wrapper {
align-self: center;
margin-inline-end: 4px;
}
.privacy-dropdown.active {
.privacy-dropdown__value {
background: $simple-background-color;
border-radius: 4px 4px 0 0;
box-shadow: 0 -4px 4px rgba($base-shadow-color, 0.1);
.icon-button {
transition: none;
2017-12-29 22:55:06 +00:00
}
&.active {
background: $ui-highlight-color;
.icon-button {
color: $primary-text-color;
}
}
2017-12-29 22:55:06 +00:00
}
&.top .privacy-dropdown__value {
border-radius: 0 0 4px 4px;
}
.privacy-dropdown__dropdown {
display: block;
box-shadow: 2px 4px 6px rgba($base-shadow-color, 0.1);
}
}
2017-12-29 22:55:06 +00:00
.privacy-dropdown__dropdown {
border-radius: 4px;
box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
background: $simple-background-color;
overflow: hidden;
transform-origin: 50% 0;
}
2017-12-29 22:55:06 +00:00
.privacy-dropdown__option {
display: flex;
align-items: center;
padding: 10px;
color: $inverted-text-color;
cursor: pointer;
2017-12-29 22:55:06 +00:00
.privacy-dropdown__option__content {
flex: 1 1 auto;
color: $lighter-text-color;
2017-12-29 22:55:06 +00:00
&:not(:first-child) {
margin-inline-start: 10px;
}
2017-12-29 22:55:06 +00:00
strong {
2017-12-29 22:55:06 +00:00
display: block;
color: $inverted-text-color;
font-weight: 500;
2017-12-29 22:55:06 +00:00
}
}
&:hover,
&.active {
background: $ui-highlight-color;
color: $primary-text-color;
2017-12-29 22:55:06 +00:00
.privacy-dropdown__option__content {
color: $primary-text-color;
2017-12-29 22:55:06 +00:00
strong {
color: $primary-text-color;
}
2017-12-29 22:55:06 +00:00
}
}
&.active:hover {
background: lighten($ui-highlight-color, 4%);
}
}
2017-12-29 22:55:06 +00:00
.compose-form__publish {
display: flex;
justify-content: flex-end;
min-width: 0;
flex: 0 0 auto;
column-gap: 5px;
2017-12-29 22:55:06 +00:00
.compose-form__publish-button-wrapper {
overflow: hidden;
padding-top: 10px;
2017-12-29 22:55:06 +00:00
button {
padding: 7px 10px;
text-align: center;
}
2017-12-29 22:55:06 +00:00
& > .side_arm {
width: 36px;
}
2017-12-29 22:55:06 +00:00
}
}
.language-dropdown {
&__dropdown {
background: $simple-background-color;
box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
border-radius: 4px;
overflow: hidden;
z-index: 2;
&.top {
transform-origin: 50% 100%;
}
&.bottom {
transform-origin: 50% 0;
}
.emoji-mart-search {
padding-inline-end: 10px;
}
.emoji-mart-search-icon {
inset-inline-end: 10px + 5px;
}
.emoji-mart-scroll {
padding: 0 10px 10px;
}
&__results {
&__item {
cursor: pointer;
color: $inverted-text-color;
font-weight: 500;
padding: 10px;
border-radius: 4px;
&:focus,
&:active,
&:hover {
background: $ui-secondary-color;
}
&__common-name {
color: $darker-text-color;
}
&.active {
background: $ui-highlight-color;
color: $primary-text-color;
outline: 0;
.language-dropdown__dropdown__results__item__common-name {
color: $secondary-text-color;
}
&:hover {
background: lighten($ui-highlight-color, 4%);
}
}
}
}
}
}