Skip to content

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

DEV: merge mobile topic.scss styles into common directory (#31712)

Kris329e1055cfcf
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 51dfe33003a..94d9b968c98 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -103,10 +103,6 @@
max-width: 100%;
}
- sup sup {
- top: 0;
- }
-
img:not(.thumbnail, .ytp-thumbnail-image, .emoji) {
max-width: 100%;
height: auto;
@@ -231,12 +227,15 @@
font-size: 1em;
}
- sub sub sub {
- bottom: 0;
+ sup sup,
+ sub sup,
+ sup sub,
+ sub sub {
+ top: 0;
}
- sup sup sup {
- top: 0;
+ sub sub sub {
+ bottom: 0;
}
}
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss
index 445a2f44a5d..ce66b86db6c 100644
--- a/app/assets/stylesheets/common/base/topic.scss
+++ b/app/assets/stylesheets/common/base/topic.scss
@@ -166,6 +166,9 @@
}
#topic-title {
+ z-index: z("base");
+ margin-bottom: 1em;
+
.title-wrapper {
display: flex;
flex-wrap: wrap;
@@ -173,11 +176,33 @@
@media screen and (min-width: 925px) {
width: 90%; // topic title isn't full-width on wide screens
}
+
+ input#edit-title {
+ width: 100%;
+ }
+
+ @include breakpoint("mobile-extra-large") {
+ .topic-category {
+ margin-top: 0.25em;
+ }
+ }
}
h1 {
margin-bottom: 0;
+ font-size: var(--font-up-4);
+ line-height: var(--line-height-medium);
+ overflow-wrap: break-word;
width: 100%;
+ z-index: z("base");
+
+ @include breakpoint("mobile-extra-large") {
+ font-size: var(--font-up-3);
+ }
+
+ a {
+ color: var(--primary);
+ }
}
a.edit-topic .d-icon {
@@ -425,3 +450,35 @@ a.topic-featured-link {
a[data-clicks]::after {
@include click-counter-badge;
}
+
+.post-info a {
+ color: var(--primary-medium);
+}
+
+.topic-error {
+ padding: 18px;
+ margin-left: auto;
+ margin-right: auto;
+ font-size: var(--font-up-4);
+ line-height: var(--line-height-medium);
+ width: 60%;
+
+ @include breakpoint("mobile-extra-large") {
+ width: 90%;
+ }
+
+ @include breakpoint("mobile-extra-large", min-width) {
+ text-align: center;
+ }
+
+ .topic-retry {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 28px;
+
+ @include breakpoint("mobile-extra-large") {
+ margin-top: 20px;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/common/topic-timeline.scss b/app/assets/stylesheets/common/topic-timeline.scss
index 719f28779e8..5289df373e1 100644
--- a/app/assets/stylesheets/common/topic-timeline.scss
+++ b/app/assets/stylesheets/common/topic-timeline.scss
@@ -72,8 +72,14 @@
display: table;
touch-action: none;
+ .topic-category {
+ margin-bottom: 0.5rem;
+ }
+
.timeline-date-wrapper {
text-align: right;
+
+ @include ellipsis;
}
.post-excerpt {
@@ -181,6 +187,11 @@
display: table;
clear: both;
}
+
+ .start-date,
+ .now-date {
+ padding: 0.5em 0;
+ }
}
.topic-timeline {
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 50887bc6aa4..526ee750f0b 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -661,10 +661,6 @@ a.attachment::before {
}
.post-info {
- a {
- color: var(--primary-med-or-secondary-med);
- }
-
a.wiki {
color: var(--wiki);
}
diff --git a/app/assets/stylesheets/desktop/topic.scss b/app/assets/stylesheets/desktop/topic.scss
index c9e8c99de58..50bc70f8720 100644
--- a/app/assets/stylesheets/desktop/topic.scss
+++ b/app/assets/stylesheets/desktop/topic.scss
@@ -16,20 +16,6 @@
}
#topic-title {
- z-index: z("base");
- margin-bottom: 1em;
-
- h1 {
- font-size: var(--font-up-4);
- line-height: var(--line-height-medium);
- overflow-wrap: break-word;
- width: 100%;
-
- a {
- color: var(--primary);
- }
- }
-
.remove-featured-link {
float: right;
text-transform: lowercase;
@@ -38,23 +24,6 @@
}
}
-.topic-error {
- padding: 18px;
- width: 60%;
- margin-left: auto;
- margin-right: auto;
- font-size: var(--font-up-4);
- text-align: center;
- line-height: var(--line-height-medium);
-
- .topic-retry {
- display: block;
- margin-top: 28px;
- margin-left: auto;
- margin-right: auto;
- }
-}
-
#topic-filter {
background-color: var(--highlight-bg);
padding: 8px;
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index cc985ce7181..15fa6adb557 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -17,7 +17,6 @@
@import "reviewables";
@import "sidebar";
@import "signup-progress-bar";
-@import "topic";
@import "topic-footer";
@import "topic-list";
@import "topic-post";
diff --git a/app/assets/stylesheets/mobile/topic.scss b/app/assets/stylesheets/mobile/topic.scss
deleted file mode 100644
index 0dabff582db..00000000000
--- a/app/assets/stylesheets/mobile/topic.scss
+++ /dev/null
@@ -1,89 +0,0 @@
-.post-info a {
- color: var(--primary-medium);
-}
-
-.topic-meta-data-inside {
- float: right;
- margin-top: -38px;
- margin-right: 5px;
-}
-
-.post-info {
- display: inline-block;
-}
-
-#topic-title {
- h1 {
- font-size: var(--font-up-3);
- line-height: var(--line-height-medium);
-
- a {
- color: var(--primary);
- vertical-align: middle;
- word-wrap: break-word;
- }
- }
-
- .title-category-wrapper {
- margin-top: 5px;
- }
-}
-
-.topic-error {
- padding: 18px;
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- font-size: var(--font-up-4);
- line-height: var(--line-height-medium);
-
- .topic-retry {
- display: block;
- margin-top: 20px;
- margin-left: auto;
- margin-right: auto;
- }
-}
-
-sup sup,
-sub sup,
-sup sub,
-sub sub {
- top: 0;
-}
-
-// inline editing of title on mobile
-#topic-title .title-wrapper {
- position: relative;
- float: none;
- width: 100%;
-
- input#edit-title {
- width: 100%;
- }
-
- .select-kit.combo-box.category-chooser {
- width: 100%;
- margin-top: 0;
- }
-
- .topic-category {
- margin-top: 0.25em;
- }
-}
-
-// make mobile timeline top and bottom dates easier to select
-.topic-timeline {
- .start-date,
- .now-date {
- padding: 0.5em 0;
- }
-
- .timeline-scrollarea-wrapper .timeline-date-wrapper {
- @include ellipsis;
- }
-
- .topic-category {
- margin-bottom: 0.5rem;
- }
-}