Skip to content

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

DEV: merge mobile stylesheets into common (#31838)

Kris7b874b6a85cf
diff --git a/app/assets/stylesheets/admin/dashboard.scss b/app/assets/stylesheets/admin/dashboard.scss
index 43134e3cd9e..c9c4a621243 100644
--- a/app/assets/stylesheets/admin/dashboard.scss
+++ b/app/assets/stylesheets/admin/dashboard.scss
@@ -49,8 +49,19 @@
}
.navigation-link {
+ @include breakpoint("mobile-extra-large") {
+ padding: 0.4em;
+ font-size: var(--font-down-1);
+ }
+
.emoji {
margin-right: 0.5em;
+
+ @include breakpoint("mobile-extra-large") {
+ width: 1.3em;
+ height: 1.3em;
+ margin-right: 0;
+ }
}
}
}
@@ -399,6 +410,12 @@
.activity-metrics {
margin-bottom: 2em;
+
+ @include breakpoint("mobile-extra-large") {
+ .counters-list {
+ font-size: var(--font-down-1);
+ }
+ }
}
.user-metrics {
@@ -788,6 +805,16 @@
&__new-feature-version {
margin-left: auto;
color: var(--primary-low-mid);
+
+ @include breakpoint("mobile-extra-large") {
+ font-size: var(--font-down-1);
+ }
+ }
+
+ @include breakpoint("mobile-extra-large") {
+ h3 {
+ margin-right: 0.5em;
+ }
}
}
diff --git a/app/assets/stylesheets/common/base/edit-category.scss b/app/assets/stylesheets/common/base/edit-category.scss
index 266ccb69662..e32a4221ac6 100644
--- a/app/assets/stylesheets/common/base/edit-category.scss
+++ b/app/assets/stylesheets/common/base/edit-category.scss
@@ -11,6 +11,10 @@ div.edit-category {
grid-column-gap: 1.5em;
grid-template-areas: "header header" "sidebar content" "sidebar warning" "sidebar footer";
+ @include breakpoint("mobile-extra-large") {
+ display: block;
+ }
+
.edit-category-title-bar {
grid-area: header;
grid-column: 1 / span 2;
@@ -21,8 +25,19 @@ div.edit-category {
background-color: var(--primary-very-low);
padding: 20px;
+ @include breakpoint("mobile-extra-large") {
+ justify-content: start;
+ align-items: center;
+ padding-bottom: 1em;
+ }
+
h2 {
@include ellipsis;
+
+ @include breakpoint("mobile-extra-large") {
+ order: 2;
+ margin-bottom: 0;
+ }
}
.category-back {
@@ -40,13 +55,58 @@ div.edit-category {
grid-area: sidebar;
grid-row: 2 / span 3;
- .nav-stacked {
+ @include breakpoint("mobile-extra-large") {
+ width: 100%;
background-color: var(--secondary);
+ position: relative;
+ border-top: 1px solid var(--primary-low);
+ border-bottom: 1px solid var(--primary-low);
+ margin: 0.5em 0;
+ overflow: hidden;
+
+ &::after {
+ background: linear-gradient(
+ to right,
+ rgba(var(--secondary-rgb), 0),
+ rgba(var(--secondary-rgb), 1)
+ );
+ content: "";
+ position: absolute;
+ right: 0;
+ height: 100%;
+ width: 30px;
+ }
+ }
+ }
+
+ .nav-stacked {
+ background-color: var(--secondary);
+
+ @include breakpoint("mobile-extra-large") {
+ white-space: nowrap;
+ flex-wrap: nowrap;
+ overflow-x: scroll;
+ display: inline-flex;
+ width: 100%;
+ margin-bottom: 0;
+
+ li {
+ font-size: var(--font-down-1);
+ border-bottom: none;
+ }
+
+ a.active::after {
+ display: none;
+ }
}
}
.edit-category-content {
grid-area: content;
+
+ @include breakpoint("mobile-extra-large") {
+ padding-top: 1em;
+ }
}
#list-area & h2 {
diff --git a/app/assets/stylesheets/common/base/sidebar.scss b/app/assets/stylesheets/common/base/sidebar.scss
index ed933660514..34190978b46 100644
--- a/app/assets/stylesheets/common/base/sidebar.scss
+++ b/app/assets/stylesheets/common/base/sidebar.scss
@@ -4,6 +4,11 @@
// ems so height is variable along with font size
--d-sidebar-row-height: 2.2em;
+
+ @include breakpoint("mobile-extra-large") {
+ --d-sidebar-row-height: 2.4em;
+ }
+
--d-sidebar-animation-time: 0.25s;
--d-sidebar-animation-ease: ease-in-out;
--d-sidebar-background: var(--secondary);
@@ -202,6 +207,10 @@
border-bottom: 2px solid transparent;
margin-bottom: -2px;
+ @include breakpoint("mobile-extra-large") {
+ grid-template-columns: 2em 4.5em repeat(2, 1fr);
+ }
+
&.header {
padding-bottom: 0;
@@ -220,6 +229,10 @@
.link-icon {
grid-column: 2;
+
+ @include breakpoint("mobile-extra-large") {
+ grid-column: 1;
+ }
}
.input-group {
@@ -260,7 +273,7 @@
grid-template-columns: auto 1fr auto;
gap: 0.5em 1em;
- @include breakpoint(mobile-extra-large) {
+ @include breakpoint("mobile-extra-large") {
grid-template-columns: auto 1fr;
justify-items: left;
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index 15fa6adb557..082173ffbd3 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -1,7 +1,5 @@
@import "compose";
-@import "dashboard";
@import "discourse";
-@import "edit-category";
@import "header";
@import "invite-signup";
@import "list-controls";
@@ -15,7 +13,6 @@
@import "post-action-feedback";
@import "push-notifications-mobile";
@import "reviewables";
-@import "sidebar";
@import "signup-progress-bar";
@import "topic-footer";
@import "topic-list";
diff --git a/app/assets/stylesheets/mobile/dashboard.scss b/app/assets/stylesheets/mobile/dashboard.scss
deleted file mode 100644
index 97131bf4d72..00000000000
--- a/app/assets/stylesheets/mobile/dashboard.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-.dashboard-next {
- .activity-metrics .counters-list {
- font-size: var(--font-down-1);
- }
-
- .navigation a.navigation-link {
- padding: 0.4em;
- font-size: var(--font-down-1);
-
- .emoji {
- width: 1.3em;
- height: 1.3em;
- margin-right: 0;
- }
- }
-
- .dashboard-new-features .section-body {
- grid-template-columns: none;
- }
-
- .admin-new-feature-item {
- &__new-feature-emoji {
- padding-left: 0;
- }
- }
-}
-
-.admin-new-feature-item {
- h3 {
- margin-right: 0.5em;
- }
-
- &__new-feature-version {
- font-size: var(--font-down-1);
- }
-}
diff --git a/app/assets/stylesheets/mobile/edit-category.scss b/app/assets/stylesheets/mobile/edit-category.scss
deleted file mode 100644
index 1810ce7d10f..00000000000
--- a/app/assets/stylesheets/mobile/edit-category.scss
+++ /dev/null
@@ -1,70 +0,0 @@
-div.edit-category {
- display: block;
-
- .edit-category-nav {
- width: 100%;
- background-color: var(--secondary);
- position: relative;
- border-top: 1px solid var(--primary-low);
- border-bottom: 1px solid var(--primary-low);
- margin: 0.5em 0;
- overflow: hidden;
-
- &::after {
- background: linear-gradient(
- to right,
- rgba(var(--secondary-rgb), 0),
- rgba(var(--secondary-rgb), 1)
- );
- content: "";
- position: absolute;
- right: 0;
- height: 100%;
- width: 30px;
- }
- }
-
- .nav-stacked {
- white-space: nowrap;
- flex-wrap: nowrap;
- overflow-x: scroll;
- display: inline-flex;
- width: 100%;
- margin-bottom: 0;
-
- li {
- font-size: var(--font-down-1);
- border-bottom: none;
- }
-
- a.active::after {
- display: none;
- }
- }
-
- .edit-category-title-bar {
- justify-content: start;
- align-items: center;
- padding-bottom: 1em;
-
- .menu-toggle {
- order: 1;
- margin-right: 1em;
- }
-
- h2 {
- order: 2;
- margin-bottom: 0;
-
- @include ellipsis;
- }
- }
-
- .edit-category-content {
- padding: 0.5em;
- }
-
- .edit-category-footer {
- padding: 0 0.5em 2em 0.5em;
- }
-}
diff --git a/app/assets/stylesheets/mobile/sidebar.scss b/app/assets/stylesheets/mobile/sidebar.scss
deleted file mode 100644
index 2d3345b2d8e..00000000000
--- a/app/assets/stylesheets/mobile/sidebar.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-:root {
- --d-sidebar-row-height: 2.4em;
-}
-
-.sidebar-section-form-modal {
- .row-wrapper {
- grid-template-columns: 4.5em repeat(2, 1fr) 2em;
-
- .link-icon {
- grid-column: 1;
- }
- }
-}