REFACTOR: Remove table layout from modals, clean up styles (#7549)

approved
#1

REFACTOR: Remove table layout from modals, clean up styles (#7549)

diff --git a/app/assets/javascripts/discourse/templates/modal/jump-to-post.hbs b/app/assets/javascripts/discourse/templates/modal/jump-to-post.hbs
index 22e8fcb..f8f8ea1 100644
--- a/app/assets/javascripts/discourse/templates/modal/jump-to-post.hbs
+++ b/app/assets/javascripts/discourse/templates/modal/jump-to-post.hbs
@@ -10,7 +10,6 @@
     </div>
 
     <div class="separator">
-      <hr class="left" />
       <span class="text">
         {{i18n "topic.progress.jump_prompt_or"}}
       </span>
diff --git a/app/assets/stylesheets/common/base/history.scss b/app/assets/stylesheets/common/base/history.scss
index 2515435..a17ad25 100644
--- a/app/assets/stylesheets/common/base/history.scss
+++ b/app/assets/stylesheets/common/base/history.scss
@@ -15,11 +15,10 @@
     display: inline-block;
     margin-bottom: 5px;
   }
-
+  table.markdown > tbody > tr > td,
   .revision-content {
     width: 47.5%;
     float: left;
-    max-width: 500px; // Safari needs a max-width to prevent overflow issues
 
     &:nth-of-type(2) {
       margin-left: 5%;
diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss
index fbe69ed..1e4d8d1 100644
--- a/app/assets/stylesheets/common/base/modal.scss
+++ b/app/assets/stylesheets/common/base/modal.scss
@@ -1,3 +1,33 @@
+// Modal wrappers
+
+.modal-outer-container {
+  width: 100%;
+  height: 100%;
+}
+
+.modal-middle-container {
+  display: flex;
+  height: 100%;
+  align-items: center;
+}
+
+.modal-inner-container {
+  box-sizing: border-box;
+  flex: 0 1 auto;
+  margin: 0 auto;
+  max-width: 700px;
+  background-color: $secondary;
+  box-shadow: shadow("modal");
+
+  .select-kit {
+    width: 220px;
+
+    &.tag-chooser {
+      width: 100%;
+    }
+  }
+}
+
 .modal-open {
   .dropdown-menu {
     z-index: z("modal", "dropdown");
@@ -45,6 +75,10 @@
     align-self: flex-start;
     order: 2;
     margin-left: auto;
+    padding-left: 2em;
+    .close {
+      color: $primary-high;
+    }
   }
 }
 
@@ -88,38 +122,6 @@
   }
 }
 
-.modal-outer-container {
-  display: table;
-  table-layout: fixed;
-  width: 100%;
-  height: 100%;
-}
-
-.modal-inner-container {
-  display: table;
-  width: 100%;
-  min-width: 320px;
-  max-width: 700px;
-  margin: 0 auto;
-  background-color: $secondary;
-  background-clip: padding-box;
-  box-shadow: shadow("modal");
-  padding: 1px;
-  box-sizing: border-box;
-
-  @media screen and (min-width: 475px) {
-    min-width: 475px;
-    width: auto;
-  }
-
-  .select-kit {
-    width: 220px;
-
-    &.tag-chooser {
-      width: 100%;
-    }
-  }
-}
 
 .create-account.in .modal-inner-container,
 .login-modal.in .modal-inner-container {
@@ -158,16 +160,6 @@
   }
 }
 
-.modal-footer:before,
-.modal-footer:after {
-  display: table;
-  content: "";
-}
-
-.modal-footer:after {
-  clear: both;
-}
-
 .modal.edit-category-modal {
   .modal-body {
     textarea {
@@ -200,6 +192,7 @@
     width: 100%;
     overflow-y: auto;
     max-height: 400px;
+
     &.full-height-modal {
       max-height: calc(100vh - 150px);
     }
@@ -216,65 +209,8 @@
     .warning {
       color: $danger !important;
     }
-    .json-uploader {
-      .jsfu-shade-container {
-        display: table-row;
-        width: 100%;
-        height: 100%;
-        position: relative;
-      }
-      .jsfu-shade {
-        z-index: z("base");
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        background-color: rgba(0, 0, 0, 0.5);
-        .text {
-          color: rgb(255, 255, 255);
-          position: absolute;
-          top: 40%;
-          font-size: $font-up-6;
-          text-align: center;
-          line-height: $line-height-medium;
-          margin-left: auto;
-          margin-right: auto;
-          left: 0;
-          right: 0;
-        }
-      }
-      .jsfu-file {
-        display: table-cell;
-        vertical-align: middle;
-        min-width: 120px;
-      }
-      .jsfu-separator {
-        vertical-align: middle;
-        display: table-cell;
-        font-size: 2.571em;
-        padding-left: 10px;
-        padding-right: 10px;
-      }
-      .jsfu-paste {
-        display: table-cell;
-        width: 100%;
-        textarea {
-          margin-bottom: 0;
-          margin-top: 4px;
-        }
-      }
-    }
-
-    pre {
-      background-color: blend-primary-secondary(5%);
-      max-height: 300px;
-      padding: 0.5em;
-      code {
-        max-height: none;
-      }
-    }
   }
+
   .password-confirmation {
     display: none;
   }
@@ -306,26 +242,17 @@
       display: block;
     }
     .d-modal-cancel {
-      margin-top: 1em;
+      margin: 1em 0 .5em;
     }
     .btn {
       text-align: left;
       font-size: $font-up-2;
       line-height: $line-height-medium;
-      width: auto;
       margin-bottom: 10px;
-      display: block;
-      margin-left: 0 !important; // override needed
       font-weight: bold;
       .topic-title {
-        font-size: $font-0;
         font-weight: normal;
       }
-      &.btn-reply-here {
-        background: $primary-low;
-        text-shadow: none;
-        color: $primary;
-      }
     }
   }
 }
@@ -341,13 +268,7 @@
 .delete-user-modal {
   .modal-footer {
     .btn {
-      font-weight: normal;
-      text-align: left;
-      font-size: $font-0;
-      line-height: $line-height-large;
-      margin-bottom: 10px;
-      display: inline-block;
-      margin-left: 0;
+      line-height: $line-height-medium;
     }
   }
 }
@@ -371,20 +292,7 @@
   }
 }
 
-#invite-modal {
-  overflow: visible;
-
-  label {
-    margin-top: 7px;
-    max-width: 450px;
-  }
-
-  .optional {
-    color: #9e9ea6;
-  }
-}
-
-.permission-list {
+.permission-list { // Category security tab
   list-style: none;
   margin: 0 0 30px;
   padding: 0;
@@ -398,6 +306,7 @@
   }
   .d-icon-times-circle {
     margin-left: 5px;
+    color: $danger;
   }
   li {
     margin-bottom: 10px;
@@ -515,16 +424,9 @@
   }
 }
 
-.modal-button-bar {
-  margin-top: 1em;
-
-  button {
-    margin-right: 0.5em;
-  }
-}
-
 .change-timestamp,
 .poll-ui-builder {
+  max-width: 420px;
   .date-picker {
     min-width: 8em;
   }
@@ -551,67 +453,55 @@
   max-height: 450px;
   .flag-action-type-details {
     width: 100%;
+    max-width: 500px;
     line-height: $line-height-large;
   }
 }
 
 .flag-message {
-  width: 95% !important;
   margin: 0;
 }
 
 .custom-message-length {
-  color: dark-light-choose($primary-low-mid, $secondary-high);
+  color: $primary-medium;
   font-size: $font-down-1;
 }
 
-.edit-category-modal {
-  .secure-category-options {
-    margin: 10px 0 0 16px;
-    .badge-list {
-      margin: 10px 0;
-      li {
-        margin: 0 4px 8px 0;
-        a {
-          color: dark-light-choose($primary-medium, $secondary-medium);
-          cursor: pointer;
-        }
-        a:hover {
-          color: dark-light-choose($primary-medium, $secondary-medium);
-        }
-      }
-    }
-  }
-}
-
 .jump-to-post-modal {
+  .modal-inner-container {
+    max-width: 350px;
+  }
   .modal-body {
+    overflow-y: visible;
     #post-jump,
     .date-picker {
       margin: 0;
       width: 100px;
     }
 
-    .pika-single {
-      position: relative !important;
+    .input-hint-text {
+      color: $primary;
     }
 
     .jump-to-post-control .index {
       color: $primary-medium;
     }
 
+    .jump-to-date-control .input-hint-text {
+        margin-left: 0;
+    }
+
     .separator {
       display: flex;
       align-items: center;
-      margin: 1em auto;
+      margin: .5em auto;
 
-      .left,
-      .right {
+      hr {
         flex: 1 0 0px;
       }
 
       .text {
-        margin: 0 0.5em;
+        margin: 0 0.5em 0 0;
         color: $primary-medium;
       }
     }
@@ -634,13 +524,6 @@
   }
 }
 
-.tabbed-modal {
-  .modal-body {
-    position: relative;
-    height: 350px;
-  }
-}
-
 .modal:not(.has-tabs) {
   .modal-tab {
     position: absolute;
diff --git a/app/assets/stylesheets/desktop/history.scss b/app/assets/stylesheets/desktop/history.scss

[... diff too long, it was truncated ...]

GitHub sha: a3f6c7d6

Approved #2
#3

I think removing this has caused some size issues for image site settings

1 Like
Follow Up #4
#6

ooh yes, I was thrown off because it was in the modal file so I thought it only applied to previews in modals. Fixing it now.

2 Likes
Approved #7