Skip to content

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

REFACTOR: merge mobile reviewables css into common (#32714)

Kris2066e8619f64
diff --git a/app/assets/stylesheets/common/base/reviewables.scss b/app/assets/stylesheets/common/base/reviewables.scss
index 8ede4338a0d..43d339f0707 100644
--- a/app/assets/stylesheets/common/base/reviewables.scss
+++ b/app/assets/stylesheets/common/base/reviewables.scss
@@ -42,22 +42,55 @@
flex-direction: row;
margin-top: 1em;
+ @include viewport.until(sm) {
+ flex-direction: column;
+ }
+
.reviewable-list {
flex: 1;
box-sizing: border-box;
max-width: 760px; // Match topic post width
min-width: 0;
margin-right: auto;
+
+ @include viewport.until(sm) {
+ order: 2;
+ width: 100%;
+ padding-bottom: 4em;
+ }
}
.reviewable-filters {
width: 250px;
height: 100%;
box-sizing: border-box;
+
+ @include viewport.until(sm) {
+ order: 1;
+ margin: 0 0 1em 0;
+ padding: 0.5em 1em 1em 1em;
+ width: 100%;
+ background-color: var(--primary-very-low);
+
+ .reviewable-filters-actions {
+ display: flex;
+ justify-content: space-between;
+ }
+
+ .reviewable-filter {
+ .filter-label {
+ margin: 0;
+ }
+ }
+ }
}
.reviewable-list + .reviewable-filters {
margin-left: 1em;
+
+ @include viewport.until(sm) {
+ margin: 0 0 0.5em 0;
+ }
}
}
}
@@ -452,6 +485,17 @@
margin: 1.5rem 0 1rem;
background: var(--secondary);
padding: 1rem;
+
+ @include viewport.until(sm) {
+ .reviewable-post-header,
+ .post-body {
+ max-width: 100%;
+
+ p {
+ overflow-x: scroll;
+ }
+ }
+ }
}
.reviewable-actions {
@@ -463,11 +507,6 @@
button {
white-space: nowrap;
}
-
- .reviewable-action,
- .reviewable-action-dropdown {
- margin-right: 0.5em;
- }
}
}
@@ -503,6 +542,13 @@
min-width: 50%;
color: var(--primary-high);
+ @include viewport.until(sm) {
+ display: flex;
+ width: 100%;
+ overflow-x: scroll;
+ border-top: 1px solid var(--primary-low);
+ }
+
&__table-wrapper {
overflow-x: scroll;
}
@@ -547,9 +593,33 @@
color: var(--danger);
}
+ @include viewport.until(sm) {
+ thead {
+ tr {
+ display: flex;
+ flex-direction: column;
+ border: 0;
+ }
+ }
+ }
+
tbody {
border-width: 1px;
+ @include viewport.until(sm) {
+ display: flex;
+ border: 0;
+
+ tr {
+ border: 0;
+ }
+
+ .reviewable-score {
+ display: flex;
+ flex-direction: column;
+ }
+ }
+
td {
white-space: nowrap;
vertical-align: baseline;
@@ -638,3 +708,9 @@
.unknown-reviewables__options {
margin-top: 1em;
}
+
+@include viewport.until(sm) {
+ .reviewable-scores-and-history table {
+ width: 100%;
+ }
+}
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index 80b9b7fa7f6..fc2f8de9aa7 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -5,7 +5,6 @@
@import "modal-overrides";
@import "post-action-feedback";
@import "push-notifications-mobile";
-@import "reviewables";
@import "signup-progress-bar";
@import "topic-footer";
@import "topic-list";
diff --git a/app/assets/stylesheets/mobile/reviewables.scss b/app/assets/stylesheets/mobile/reviewables.scss
deleted file mode 100644
index 1c53de85f34..00000000000
--- a/app/assets/stylesheets/mobile/reviewables.scss
+++ /dev/null
@@ -1,112 +0,0 @@
-.reviewable {
- .reviewable-container {
- flex-direction: column;
-
- .reviewable-list {
- order: 2;
- width: 100%;
- padding-bottom: 4em;
- }
-
- .reviewable-filters {
- order: 1;
- margin: 0;
- padding: 0.5em;
- width: 100%;
- }
-
- .reviewable-list + .reviewable-filters {
- margin: 0 0 0.5em 0;
- }
- }
-
- .reviewable-scores {
- display: flex;
- width: 100%;
- overflow-x: scroll;
- border-top: 1px solid var(--primary-low);
-
- thead {
- tr {
- display: flex;
- flex-direction: column;
- border: 0;
- }
- }
-
- tbody {
- display: flex;
- border: 0;
-
- .reviewable-score {
- display: flex;
- flex-direction: column;
- }
-
- tr {
- border: 0;
- }
-
- td {
- white-space: nowrap;
- }
- }
- }
-}
-
-.reviewable-filters {
- background-color: var(--primary-very-low);
- padding: 0.5em 1em 1em 1em;
- margin-bottom: 1em;
-
- .reviewable-filters-actions {
- display: flex;
- justify-content: space-between;
- }
-
- .reviewable-filter {
- .filter-label {
- margin: 0;
- }
- }
-}
-
-.reviewable-contents {
- .reviewable-post-header,
- .post-body {
- max-width: 100%;
-
- p {
- overflow-x: scroll;
- }
- }
-}
-
-.reviewable-actions {
- margin-right: -0.5em;
- margin-bottom: 0.5em;
-
- > div,
- > button {
- margin-right: 0.25em;
- }
-
- .btn.reviewable-action {
- margin-bottom: 0;
- }
-
- .reviewable-action,
- .reviewable-action-dropdown .dropdown-select-box-header {
- display: flex;
- align-items: center;
- justify-content: center;
-
- .d-icon {
- margin: 0 0.15 0 0;
- }
- }
-}
-
-.reviewable-scores-and-history table {
- width: 100%;
-}