Skip to content

A platform for community discussion. Free, open, simple.

REFACTOR: move desktop and mobile composer stylesheets into common (#31936)

Krisbbea7c3b1105
diff --git a/app/assets/javascripts/discourse/app/components/composer-container.gjs b/app/assets/javascripts/discourse/app/components/composer-container.gjs
index a644a17eaca..09db37db5c1 100644
--- a/app/assets/javascripts/discourse/app/components/composer-container.gjs
+++ b/app/assets/javascripts/discourse/app/components/composer-container.gjs
@@ -44,11 +44,14 @@ export default class ComposerContainer extends Component {
<div class="grippie"></div>
{{#if this.composer.visible}}
{{htmlClass (if this.composer.isPreviewVisible "composer-has-preview")}}
- <ComposerMessages
- @composer={{this.composer.model}}
- @messageCount={{this.composer.messageCount}}
- @addLinkLookup={{this.composer.addLinkLookup}}
- />
+
+ {{#unless this.site.mobileView}}
+ <ComposerMessages
+ @composer={{this.composer.model}}
+ @messageCount={{this.composer.messageCount}}
+ @addLinkLookup={{this.composer.addLinkLookup}}
+ />
+ {{/unless}}
{{#if this.composer.showFullScreenPrompt}}
<ComposerFullscreenPrompt
@@ -292,11 +295,6 @@ export default class ComposerContainer extends Component {
{{/if}}
{{#if this.site.mobileView}}
- {{#if this.composer.whisperOrUnlistTopic}}
- <span class="whisper">
- {{icon "far-eye-slash"}}
- </span>
- {{/if}}
{{#if this.composer.model.noBump}}
<span class="no-bump">{{icon "anchor"}}</span>
@@ -378,11 +376,11 @@ export default class ComposerContainer extends Component {
</div>
{{/if}}
- <div
- class={{if this.composer.isUploading "hidden"}}
- id="draft-status"
- >
- {{#if this.composer.model.draftStatus}}
+ {{#if this.composer.model.draftStatus}}
+ <div
+ class={{if this.composer.isUploading "hidden"}}
+ id="draft-status"
+ >
<span
class="draft-error"
title={{this.composer.model.draftStatus}}
@@ -400,8 +398,8 @@ export default class ComposerContainer extends Component {
{{this.composer.model.draftStatus}}
{{/if}}
</span>
- {{/if}}
- </div>
+ </div>
+ {{/if}}
{{#if (and this.composer.allowPreview this.site.desktopView)}}
<DButton
diff --git a/app/assets/javascripts/discourse/app/components/composer-toggles.gjs b/app/assets/javascripts/discourse/app/components/composer-toggles.gjs
index cc77288157f..c5c241e0e51 100644
--- a/app/assets/javascripts/discourse/app/components/composer-toggles.gjs
+++ b/app/assets/javascripts/discourse/app/components/composer-toggles.gjs
@@ -63,7 +63,7 @@ export default class ComposerToggles extends Component {
@action={{this.toggleToolbar}}
@title={{this.toggleToolbarTitle}}
@preventFocus={{true}}
- class="btn-flat toggle-toolbar btn-mini-toggle"
+ class="btn-transparent toggle-toolbar btn-mini-toggle"
/>
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.js
index 5f0235e1274..95f3e4ac6eb 100644
--- a/app/assets/javascripts/discourse/app/services/composer.js
+++ b/app/assets/javascripts/discourse/app/services/composer.js
@@ -124,7 +124,6 @@ export default class ComposerService extends Service {
composerHeight = null;
@and("site.mobileView", "showPreview") forcePreview;
- @or("isWhispering", "model.unlistTopic") whisperOrUnlistTopic;
@alias("site.categoriesList") categories;
@alias("topicController.model") topicModel;
@reads("currentUser.staff") isStaffUser;
diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scss
index cca18dde3aa..01afc1a922b 100644
--- a/app/assets/stylesheets/common/base/compose.scss
+++ b/app/assets/stylesheets/common/base/compose.scss
@@ -41,8 +41,22 @@ html.composer-open {
}
.reply-area {
+ box-sizing: border-box;
display: flex;
flex-direction: column;
+ padding: 0.5em;
+
+ @include breakpoint("mobile-extra-large") {
+ padding-bottom: max(env(safe-area-inset-bottom), 6px);
+ flex-grow: 1;
+ min-height: 0;
+ }
+
+ @include breakpoint("mobile-extra-large", min-width) {
+ margin: 0 auto;
+ height: calc(100% - 11px);
+ width: 100%;
+ }
}
.with-form-template {
@@ -84,6 +98,28 @@ html.composer-open {
min-height: var(--min-height);
max-height: calc(100vh - var(--header-offset, 4em));
padding-bottom: var(--composer-ipad-padding);
+
+ @include breakpoint("mobile-extra-large") {
+ z-index: z("mobile-composer");
+ }
+
+ .grippie {
+ cursor: row-resize;
+ padding: 0.25em 0;
+ background: var(--tertiary);
+
+ @media (pointer: coarse) {
+ padding: 0.35em 0;
+ }
+
+ &::before {
+ content: "";
+ display: block;
+ width: 1.5em;
+ margin: auto;
+ border-top: 3px double var(--tertiary-medium);
+ }
+ }
}
&.draft,
@@ -132,11 +168,15 @@ html.composer-open {
.reply-to {
color: var(--primary-high);
- margin-bottom: 8px;
+ margin-bottom: 0.5em;
display: flex;
align-items: center;
justify-content: flex-end;
+ @include breakpoint("mobile-extra-large") {
+ justify-content: space-between;
+ }
+
.reply-details {
flex: 1;
display: flex;
@@ -147,6 +187,10 @@ html.composer-open {
.d-icon {
color: var(--primary-medium);
}
+
+ @include breakpoint("mobile-extra-large") {
+ max-width: calc(100% - 75px);
+ }
}
.composer-action-title {
@@ -196,6 +240,24 @@ html.composer-open {
gap: 8px;
margin-left: 8px;
}
+
+ // Protection for languages with long strings on very small screens. This
+ // has no effect on most users but we need it for some cases. If this is
+ // not added, "add edit reason" will overlap with the composer controls
+ @include breakpoint(mobile-small) {
+ .reply-details {
+ flex-wrap: wrap;
+ }
+
+ .display-edit-reason {
+ margin-top: 0.5em;
+ }
+
+ .composer-controls {
+ align-self: flex-start;
+ gap: 6px;
+ }
+ }
}
.whisper,
@@ -234,10 +296,17 @@ html.composer-open {
width: 100%;
align-items: center;
position: relative;
+ gap: 0 0.5em;
}
.user-selector {
- margin-bottom: 8px;
+ @include breakpoint("mobile-extra-large") {
+ flex-wrap: wrap;
+ }
+
+ @include breakpoint("mobile-extra-large", min-width) {
+ margin-bottom: 0.5em;
+ }
}
.title-input {
@@ -255,6 +324,13 @@ html.composer-open {
flex: 1 1 100%;
}
+ @include breakpoint("mobile-extra-large") {
+ .mini-tag-chooser,
+ .category-chooser {
+ z-index: z("base");
+ }
+ }
+
.archetype-private_message & {
// PMs don't have categories, so we need a wider tag input
.mini-tag-chooser {
@@ -331,17 +407,33 @@ html.composer-open {
.add-warning {
color: var(--primary-high);
- padding-left: 8px;
- margin-bottom: 0;
+ padding: 0.5em;
display: flex;
+ line-height: var(--line-height-medium);
+ margin: 0;
+
+ @include breakpoint("mobile-extra-large") {
+ margin-bottom: 0.15em;
+ }
input {
margin-right: 8px;
}
}
+ @include breakpoint("mobile-extra-large") {
+ .users-input,
+ .add-warning {
+ width: 100%;
+ }
+
+ .users-input .select-kit.multi-select {
+ width: 100%;
+ }
+ }
+
#reply-title {
- margin-bottom: 8px;
+ margin-bottom: 0.5em;
flex-basis: 50%;
width: unset;
@@ -351,16 +443,20 @@ html.composer-open {
}
.category-input + .tags-input {
- margin-left: 8px;
width: auto;
- max-width: calc(50% - 4px);
+ max-width: calc(50% - 0.25em);
}
.tags-input {
position: relative;
- margin: 0 0 8px 0;
+ margin: 0 0 0.5em 0;
flex-grow: 1;
+ @include breakpoint("mobile-extra-large") {
+ width: 100%;
+ max-width: 50%;
+ }
+
.mini-tag-chooser {
z-index: z("composer", "dropdown");
width: 100%;
@@ -377,13 +473,43 @@ html.composer-open {
flex-direction: column;
flex-grow: 1;
min-height: 0;
+
+ &:not(.toolbar-visible) {
+ .d-editor-button-bar {
+ display: none;
+ }
+ }
}
.submit-panel {
align-items: center;
display: flex;
flex-shrink: 0;
- margin-top: 8px;
+ margin-top: 0.5em;
+
+ @include breakpoint("mobile-extra-large") {
+ flex-wrap: wrap;
+ gap: 0.25em 0;
+
+ .create {
+ max-width: 50vw;
+
+ span {
+ @include ellipsis;
+ }
+ }
+ }
+
+ .mobile-file-upload {
+ &.hidden + .mobile-preview {
+ // Hide preview button while file is uploading to make room for upload progress
+ display: none;
+ }
+ }
+
+ .mobile-preview {
+ margin-left: 0.25em;
+ }
}
.save-or-cancel {
@@ -392,6 +518,11 @@ html.composer-open {
flex: 0 1 auto;
margin-right: 1em;
+ @include breakpoint("mobile-extra-large") {
+ margin-right: 0.5em;
+ flex: 1 1 auto;
+ }
+
.btn-primary {
flex: 0 0 auto;
}
@@ -415,6 +546,14 @@ html.composer-open {
background-color: transparent;
background-image: none;
}
+
+ @include breakpoint("mobile-extra-large") {
+ .d-icon {
+ font-size: var(--font-up-2);
+ color: var(--primary-medium);
+ padding: 0.35em;
+ }
+ }
}
.preview-template {
@@ -426,6 +565,14 @@ html.composer-open {
#file-uploading {
color: var(--primary-high);
margin-right: 0.5em;
+
+ @include breakpoint("mobile-extra-large") {
+ margin-left: 0.5em;
+ }
+
+ @include breakpoint("mobile-extra-large", min-width) {
+ text-align: right;
+ }
}
#file-uploading {
@@ -467,6 +614,67 @@ html.composer-open {
color: var(--primary-high);
}
}
+
+ .select-kit.is-expanded {
+ z-index: z("composer", "dropdown") + 1;
+
+ &.user-chooser {
+ // keeps user chooser a layer above AI autocomplete
+ z-index: z("composer", "dropdown") + 2;
+ }
+ }
+
+ @include breakpoint("mobile-extra-large", min-width) {
+ &.private-message {
+ .with-tags {
+ .title-and-category {
+ flex-wrap: nowrap;
+ gap: 0.5em;
+
+ .tags-input {
+ max-width: 50%;
+ flex: 1 1 auto;
+ }
+ }
+
+ .title-input {
+ max-width: 50%;
+ min-width: 0;
+
+ input {
+ min-width: 0;
+ }
+ }
+ }
+
+ #private-message-users,
+ .users-input {
+ width: 100%;
+ flex: 0 0 auto;
+
+ &.can-warn {
+ // space for warning, inverse of mini-tag-chooser width
+ width: 60%;
+ }
+ }
+
+ .add-warning {
+ flex: 1 1 auto;
+ overflow: hidden;
+
+ span {
+ // protects the space of the user input in case there's a very long translation
+ @include ellipsis;
+ }
+ }
+ }
+ }
+
+ &.closed {
+ .grippie {
+ display: none;
+ }
+ }
}
.autocomplete {
@@ -479,6 +687,10 @@ html.composer-open {
box-shadow: var(--shadow-dropdown);
border-radius: 8px;
+ @include breakpoint("mobile-extra-large", min-width) {
+ max-width: 600px;
+ }
+
ul {
list-style: none;
padding: 0;
@@ -718,6 +930,10 @@ div.ac-wrap {
.grippie {
display: none;
}
+
+ .reply-area {
+ padding-bottom: 0.375em;
+ }
}
&.composer-open .with-topic-progress {
@@ -735,6 +951,43 @@ div.ac-wrap {
&.open.show-preview {
height: 70vh;
}
+
+ &.show-preview {
+ .submit-panel {
+ padding-top: 0.5em;
+ z-index: z("fullscreen") + 1;
+ background-color: var(--secondary);
+
+ .cancel,
+ .mobile-file-upload,
+ .mobile-preview {
+ display: none;
+ }
+ }
+
+ .d-editor-preview-wrapper {
+ position: absolute;
+ z-index: z("fullscreen");
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: var(--secondary);
+ border-bottom: 40px solid var(--secondary);
+ max-width: 100%;
+ margin: 0;
+ padding: 0.5em;
+ overflow: auto;
+
+ .d-editor-preview {
+ margin-bottom: 40px;
+ }
+ }
+
+ .composer-controls {
+ display: none;
+ }
+ }
}
}
@@ -772,3 +1025,288 @@ div.ac-wrap {
animation: blink_input_opacity_to_prevent_scrolling_when_focus 0.01s;
}
}
+
+.composer-popup {
+ box-sizing: border-box;
+ position: absolute;
+ width: calc(50% - 16px);
+ top: 19px; // grippie (11px) + .reply-area padding (8px)
+ bottom: 8px;
+ right: 8px;
+ overflow-y: auto;
+ z-index: z("composer", "dropdown") + 1;
+ padding: 1.5em;
+ box-shadow: var(--shadow-dropdown);
+ background: var(--highlight-bg);
+
+ > p,
+ h3 {
+ &:first-of-type {
+ margin-top: 0;
+ margin-right: 3em;
+ }
+ }
+
+ &.urgent {
+ background: var(--danger-low);
+ }
+
+ &.education-message {
+ background-color: var(--tertiary-low);
+ }
+
+ &.dominating-topic-message,
+ &.get-a-room {
+ bottom: unset;
+ padding: 2.25em 6em 2.5em 2.25em;
+
+ p {
+ font-size: var(--font-up-1);
+ }
+
+ button:not(.close) {
+ margin-top: 0.5em;
+ }
+ }
+
+ h3 {
+ margin-bottom: 10px;
+ }
+
+ .btn.close {
+ flex-direction: row-reverse;
+ align-items: center;
+ position: absolute;
+ right: 0;
+ top: 0;
+ color: var(--primary-medium);
+ font-size: var(--font-0);
+
+ .d-icon {
+ color: currentcolor;
+ font-size: var(--font-up-1);
+ margin: 0 0 0 0.25em;
+ }
+
+ .discourse-no-touch & {
+ &:active,
+ &:focus {
+ background: transparent;
+
+ .d-icon {
+ color: var(--primary);
+ }
+ }
+ }
+ }
+
+ ul {
+ margin: 0;
+ padding: 0 0 0 1.5em;
+
+ &.list,
+ &.topics {
+ list-style: none;
+ padding: 0;
+ }
+
+ li {
+ font-weight: normal;
+ margin-top: 8px;
+ }
+ }
+
+ &:nth-of-type(2) {
+ width: calc(50% - 65px);
+ }
+}
+
+.custom-body {
+ background-color: var(--tertiary-low);
+
+ p {
+ max-width: 98%;
+ }
+}
+
+.similar-topics {
+ background-color: var(--tertiary-low);
+
+ .similar-topic {
+ margin-bottom: 0.5em;
+ }
+
+ a[href] {
+ color: var(--primary);
+ }
+
+ .posts-count {
+ background-color: var(--tertiary);
+ }
+
+ .topic-title {
+ flex: 0 1 auto;
+ margin-right: 0.5em;
+ }
+
+ span.badge-wrapper {
+ margin-left: 0;
+ }
+
+ .blurb {
+ color: var(--primary-high);
+ }
+
+ .topic-title,
+ .blurb {
+ margin-bottom: 0.5em;
+
+ .d-icon {
+ color: var(--primary-high);
+ }
+ }
+
+ span.topic {
+ display: flex;
+ flex-direction: column;
+
+ .first-line {
+ flex: 1;
+ }
+
+ .second-line {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: baseline;
+ gap: 0.5em;
+
+ .discourse-tags {
+ font-size: var(--font-down-1);
+ }
+ }
+ }
+}
+
+.fullscreen-composer {
+ overflow: hidden;
+
+ .profiler-results {
+ display: none;
+ }
+
+ #reply-control {
+ &.fullscreen {
+ // important needed because of inline styles when height is changed manually with grippie
+ height: 100vh !important;
+ max-height: 100%; // prevents devices from miscalculating using vh
+ z-index: z("header") + 1;
+
+ @supports (--custom: property) {
+ height: calc(var(--composer-vh, 1vh) * 100) !important;
+ }
+
+ .d-editor-preview-wrapper {
+ margin-top: 1%;
+ }
+
+ .reply-to {
+ border-bottom: 1px solid var(--primary-low);
+ margin-bottom: 0;
+ padding-bottom: 8px;
+ }
+
+ .d-editor-textarea-wrapper {
+ border: none;
+ }
+
+ &.show-preview .d-editor-textarea-wrapper {
+ border-right: 1px solid var(--primary-low);
+ }
+
+ #draft-status,
+ #file-uploading {
+ margin-left: 0;
+ text-align: initial;
+ }
+
+ .composer-popup {
+ top: 30px;
+ }
+
+ &::before {
+ content: "";
+ background: var(--secondary);
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ z-index: -1;
+ left: 0;
+ }
+ }
+ }
+}
+
+.composer-fullscreen-prompt {
+ animation: fadeIn 1s ease-in-out;
+ animation-delay: 1.5s;
+ animation-direction: reverse;
+ animation-fill-mode: forwards;
+ position: fixed;
+ left: 50%;
+ top: 10%;
+ transform: translate(-50%, 0);
+ z-index: z("header") + 1;
+ background: var(--primary-very-high);
+ color: var(--secondary);
+ padding: 0.5em 0.75em;
+ pointer-events: none;
+ border-radius: 2px;
+
+ @media (prefers-reduced-motion) {
+ animation-duration: 0s;
+ }
+
+ .rtl & {
+ // R2 is not smart enough to support this swap
+ transform: translate(50%, 0);
+ }
+
+ kbd {
+ background: none;
+ }
+}
+
+@media screen and (min-width: $reply-area-max-width) {
+ .sidebar-wrapper .sidebar-container {
+ .has-sidebar-page & {
+ height: auto;
+ }
+ }
+
+ #reply-control:not(.fullscreen) {
+ .has-sidebar-page & {
+ width: auto;
+ max-width: calc(
+ (var(--d-max-width) + (var(--d-sidebar-width) / 2)) - 1.5rem
+ );
+ margin-left: 0;
+ margin-right: 0;
+ transform: translateX(
+ calc(
+ ((100vw - var(--d-max-width) - (var(--d-sidebar-width) / 0.5)) / 2) +
+ 17em + 1rem
+ )
+ );
+
+ &.hide-preview {
+ max-width: calc(740px);
+ transform: translateX(
+ calc(
+ ((100vw - 740px - var(--d-sidebar-width)) / 2) +
+ var(--d-sidebar-width)
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss
index e72841ffa56..649d7beb2f4 100644
--- a/app/assets/stylesheets/desktop/_index.scss
+++ b/app/assets/stylesheets/desktop/_index.scss
@@ -1,5 +1,4 @@
@import "category-list";
-@import "compose";
@import "discourse";
@import "header";
@import "latest-topic-list";
diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss
deleted file mode 100644
index f60c51162fa..00000000000
--- a/app/assets/stylesheets/desktop/compose.scss
+++ /dev/null
@@ -1,400 +0,0 @@
-#reply-control {
- .reply-area {
- margin: 0 auto;
- padding: 8px;
- box-sizing: border-box;
- height: calc(100% - 11px);
- width: 100%;
-
- .submit-panel {
- flex-wrap: wrap;
- }
- }
-
- .autocomplete {
- max-width: 600px;
- }
-
- .select-kit.is-expanded {
- z-index: z("composer", "dropdown") + 1;
- }
-
- &.private-message {
- .with-tags {
- .title-and-category {
- flex-wrap: nowrap;
- gap: 0.5em;
-
- .tags-input {
- max-width: 50%;
- flex: 1 1 auto;
- }
- }
-
- .title-input {
- max-width: 50%;
- min-width: 0;
-
- input {
- min-width: 0;
- }
- }
- }
-
- #private-message-users,
- .users-input {
- width: 100%;
- flex: 0 0 auto;
-
- &.can-warn {
- // space for warning, inverse of mini-tag-chooser width
- width: 60%;
- }
- }
-
- .add-warning {
- flex: 1 1 auto;
- overflow: hidden;
-
- span {
- // protects the space of the user input in case there's a very long translation
- @include ellipsis;
- }
- }
- }
-}
-
-.closed {
- .grippie {
- display: none;
- }
-}
-
-.open {
- .grippie {
- cursor: row-resize;
- padding: 4px 0;
- background: var(--tertiary);
-
- &::before {
- content: "";
- display: block;
- width: 24px;
- margin: auto;
- border-top: 3px double var(--tertiary-medium);
- }
- }
-}
-
-.discourse-touch {
- .open {
- .grippie {
- padding: 7px 0;
- }
- }
-}
-
-.composer-popup {
- box-sizing: border-box;
- position: absolute;
- width: calc(50% - 16px);
- top: 19px; // grippie (11px) + .reply-area padding (8px)
- bottom: 8px;
- right: 8px;
- overflow-y: auto;
- z-index: z("composer", "dropdown") + 1;
- padding: 1.5em;
- box-shadow: var(--shadow-dropdown);
- background: var(--highlight-bg);
-
- > p,
- h3 {
- &:first-of-type {
- margin-top: 0;
- margin-right: 3em;
- }
- }
-
- &.urgent {
- background: var(--danger-low);
- }
-
- &.education-message {
- background-color: var(--tertiary-low);
- }
-
- &.dominating-topic-message,
- &.get-a-room {
- bottom: unset;
- padding: 2.25em 6em 2.5em 2.25em;
-
- p {
- font-size: var(--font-up-1);
- }
-
- button:not(.close) {
- margin-top: 0.5em;
- }
- }
-
- h3 {
- margin-bottom: 10px;
- }
-
- .btn.close {
- flex-direction: row-reverse;
- align-items: center;
- position: absolute;
- right: 0;
- top: 0;
- color: var(--primary-medium);
- font-size: var(--font-0);
-
- .d-icon {
- color: currentcolor;
- font-size: var(--font-up-1);
- margin: 0 0 0 0.25em;
- }
-
- .discourse-no-touch & {
- &:active,
- &:focus {
- background: transparent;
-
- .d-icon {
- color: var(--primary);
- }
- }
- }
- }
-
- ul {
- margin: 0;
- padding: 0 0 0 1.5em;
-
- &.list,
- &.topics {
- list-style: none;
- padding: 0;
- }
-
- li {
- font-weight: normal;
- margin-top: 8px;
- }
- }
-}
-
-.composer-controls {
- .d-chevron-down {
- vertical-align: text-top;
- }
-}
-
-.custom-body {
- background-color: var(--tertiary-low);
-
- p {
- max-width: 98%;
- }
-}
-
-.similar-topics {
- background-color: var(--tertiary-low);
-
- .similar-topic {
- margin-bottom: 0.5em;
- }
-
- a[href] {
- color: var(--primary);
- }
-
- .posts-count {
- background-color: var(--tertiary);
- }
-
- .topic-title {
- flex: 0 1 auto;
- margin-right: 0.5em;
- }
-
- span.badge-wrapper {
- margin-left: 0;
- }
-
- .blurb {
- color: var(--primary-high);
- }
-
- .topic-title,
- .blurb {
- margin-bottom: 0.5em;
-
- .d-icon {
- color: var(--primary-high);
- }
- }
-
- span.topic {
- display: flex;
- flex-direction: column;
-
- .first-line {
- flex: 1;
- }
-
- .second-line {
- display: flex;
- flex-wrap: wrap;
- align-items: baseline;
- gap: 0.5em;
-
- .discourse-tags {
- font-size: var(--font-down-1);
- }
- }
- }
-}
-
-.composer-popup:nth-of-type(2) {
- width: calc(50% - 65px);
-}
-
-a.toggle-preview {
- color: var(--primary-high);
-
- &:hover {
- color: var(--tertiary);
- }
-}
-
-#draft-status,
-#file-uploading {
- text-align: right;
-}
-
-// fullscreen composer styles
-.fullscreen-composer {
- overflow: hidden;
-
- .profiler-results {
- display: none;
- }
-
- #reply-control {
- &.fullscreen {
- // important needed because of inline styles when height is changed manually with grippie
- height: 100vh !important;
- max-height: 100%; // prevents devices from miscalculating using vh
- z-index: z("header") + 1;
-
- @supports (--custom: property) {
- height: calc(var(--composer-vh, 1vh) * 100) !important;
- }
-
- .d-editor-preview-wrapper {
- margin-top: 1%;
- }
-
- .reply-to {
- border-bottom: 1px solid var(--primary-low);
- margin-bottom: 0;
- padding-bottom: 8px;
- }
-
- .d-editor-textarea-wrapper {
- border: none;
- }
-
- &.show-preview .d-editor-textarea-wrapper {
- border-right: 1px solid var(--primary-low);
- }
-
- #draft-status,
- #file-uploading {
- margin-left: 0;
- text-align: initial;
- }
-
- .composer-popup {
- top: 30px;
- }
-
- &::before {
- content: "";
- background: var(--secondary);
- width: 100%;
- height: 100%;
- position: fixed;
- z-index: -1;
- left: 0;
- }
- }
- }
-}
-
-.composer-fullscreen-prompt {
- animation: fadeIn 1s ease-in-out;
- animation-delay: 1.5s;
- animation-direction: reverse;
- animation-fill-mode: forwards;
- position: fixed;
- left: 50%;
- top: 10%;
- transform: translate(-50%, 0);
- z-index: z("header") + 1;
- background: var(--primary-very-high);
- color: var(--secondary);
- padding: 0.5em 0.75em;
- pointer-events: none;
- border-radius: 2px;
-
- @media (prefers-reduced-motion) {
- animation-duration: 0s;
- }
-
- .rtl & {
- // R2 is not smart enough to support this swap
- transform: translate(50%, 0);
- }
-
- kbd {
- background: none;
- }
-}
-
-@media screen and (min-width: $reply-area-max-width) {
- .sidebar-wrapper .sidebar-container {
- .has-sidebar-page & {
- height: auto;
- }
- }
-
- #reply-control:not(.fullscreen) {
- .has-sidebar-page & {
- width: auto;
- max-width: calc(
- (var(--d-max-width) + (var(--d-sidebar-width) / 2)) - 1.5rem
- );
- margin-left: 0;
- margin-right: 0;
- transform: translateX(
- calc(
- ((100vw - var(--d-max-width) - (var(--d-sidebar-width) / 0.5)) / 2) +
- 17em + 1rem
- )
- );
-
- &.hide-preview {
- max-width: calc(740px);
- transform: translateX(
- calc(
- ((100vw - 740px - var(--d-sidebar-width)) / 2) +
- var(--d-sidebar-width)
- )
- );
- }
- }
- }
-}
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index 082173ffbd3..922b1066383 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -1,4 +1,3 @@
-@import "compose";
@import "discourse";
@import "header";
@import "invite-signup";
diff --git a/app/assets/stylesheets/mobile/compose.scss b/app/assets/stylesheets/mobile/compose.scss
deleted file mode 100644
index 51069d24a98..00000000000
--- a/app/assets/stylesheets/mobile/compose.scss
+++ /dev/null
@@ -1,226 +0,0 @@
-.composer-popup-container {
- display: none !important; // can be removed if inline JS CSS is removed from composer-popup
-}
-
-.composer-popup {
- display: none !important; // can be removed if inline JS CSS is removed from composer-popup
-}
-
-#reply-control {
- .reply-area {
- padding: 6px;
- padding-bottom: max(env(safe-area-inset-bottom), 6px);
- flex-grow: 1;
- min-height: 0;
- }
-
- &.open {
- z-index: z("mobile-composer");
- }
-
- .keyboard-visible &.open .reply-area {
- padding-bottom: 6px;
- }
-
- .reply-to {
- justify-content: space-between;
- margin-bottom: 6px;
-
- .reply-details {
- max-width: calc(100% - 75px);
- }
-
- // Protection for languages with long strings on very small screens. This
- // has no effect on most users but we need it for some cases. If this is
- // not added, "add edit reason" will overlap with the composer controls
- @include breakpoint(mobile-small) {
- .reply-details {
- flex-wrap: wrap;
- }
-
- .display-edit-reason {
- margin-top: 0.5em;
- }
-
- .composer-controls {
- align-self: flex-start;
- gap: 6px;
- }
- }
- }
-
- .toggle-minimize {
- .d-icon-chevron-down {
- vertical-align: text-top;
- }
- }
-
- &.draft {
- .toggle-toolbar,
- .toggle-minimize {
- top: 6px;
- }
- }
-
- #reply-title {
- width: calc(100% - 20px);
- margin-bottom: 6px;
- }
-
- .category-input,
- .with-tags.with-category .category-input {
- margin-bottom: 6px;
- max-width: calc(50% - 3px);
- }
-
- .submit-panel {
- margin-top: 6px;
- flex-wrap: wrap;
- gap: 0.25em 0;
-
- .create {
- max-width: 50vw;
-
- span {
- @include ellipsis;
- }
- }
-
- .save-or-cancel {
- margin-right: 0.5em;
- flex: 1 1 auto;
-
- #draft-status,
- #file-uploading {
- margin-left: 6px;
- }
-
- .cancel .d-icon {
- font-size: 1.4em;
- color: var(--primary-low-mid);
- padding: 3px 6px;
- }
- }
-
- .mobile-file-upload:not(.hidden),
- .mobile-preview {
- // Alignment fix, remove if converted to buttons
- display: inline-flex;
- }
-
- .mobile-file-upload {
- &.hidden + .mobile-preview {
- // Hide preview button while file is uploading to make room for upload progress
- display: none;
- }
- }
-
- .mobile-preview {
- margin-left: 0.25em;
- }
- }
-
- &.show-preview {
- .submit-panel {
- padding-top: 10px;
- z-index: z("fullscreen") + 1;
- background-color: var(--secondary);
-
- .cancel,
- .mobile-file-upload,
- .mobile-preview {
- display: none;
- }
- }
-
- .d-editor-preview-wrapper {
- position: absolute;
- z-index: z("fullscreen");
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: var(--secondary);
- border-bottom: 40px solid var(--secondary);
- max-width: 100%;
- margin: 0;
- padding: 10px;
- overflow: auto;
-
- .d-editor-preview {
- margin-bottom: 40px;
- }
- }
-
- .composer-controls {
- display: none;
- }
- }
-
- &.hide-preview {
- .d-editor-preview-wrapper {
- display: none;
- }
- }
-
- .wmd-controls:not(.toolbar-visible) {
- .d-editor-button-bar {
- display: none;
- }
- }
-
- .d-editor-button-bar .btn {
- &.preview {
- margin: 0;
- }
- }
-
- .title-and-category,
- .user-selector {
- margin: 0;
-
- .users-input {
- margin-bottom: 6px;
- }
- }
-
- .with-tags {
- .mini-tag-chooser,
- .category-chooser {
- z-index: z("base");
- }
-
- .tags-input {
- margin: 0 0 6px 6px;
- max-width: calc(50% - 3px);
- width: 100%;
- }
- }
-
- .without-tags {
- .category-input {
- margin-left: 6px;
- }
- }
-
- .user-selector {
- flex-wrap: wrap;
- }
-
- .users-input,
- .add-warning {
- width: 100%;
- }
-
- .users-input .select-kit.multi-select {
- width: 100%;
- }
-
- .add-warning {
- margin-bottom: 6px;
- }
-
- .whisper {
- margin-right: 6px;
- }
-}