فهرست منبع

Merge pull request #22817 from overleaf/rd-migrate-admin-split-test-create-bs5

Migrate the split test create admin page to Bootstrap 5

GitOrigin-RevId: 897f634b00136605ce3faf0e2489902d41f51566
Rebeka Dekany 1 سال پیش
والد
کامیت
bdd91358ef

+ 30 - 0
services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss

@@ -174,3 +174,33 @@
     border-bottom-color: transparent;
     border-bottom-color: transparent;
   }
   }
 }
 }
+
+// Form validation states
+
+@mixin form-control-validation($color) {
+  color: $color;
+
+  // Color the label and help text
+  .help-block,
+  .control-label,
+  .radio,
+  .checkbox,
+  .radio-inline,
+  .checkbox-inline,
+  .form-label {
+    color: $color;
+  }
+
+  .form-control {
+    border-color: $color;
+
+    &:focus {
+      border-color: $border-active;
+    }
+  }
+
+  // Optional feedback icon
+  .form-control-feedback {
+    color: $color;
+  }
+}

+ 18 - 0
services/web/frontend/stylesheets/bootstrap-5/components/form.scss

@@ -223,3 +223,21 @@
   border-color: $input-focus-border-color;
   border-color: $input-focus-border-color;
   box-shadow: $form-check-input-focus-box-shadow;
   box-shadow: $form-check-input-focus-box-shadow;
 }
 }
+
+input[type='range'] {
+  display: block;
+  width: 100%;
+}
+
+// Feedback states
+.has-success {
+  @include form-control-validation($bg-accent-01);
+}
+
+.has-warning {
+  @include form-control-validation($bg-warning-03);
+}
+
+.has-error {
+  @include form-control-validation($bg-danger-01);
+}

+ 74 - 0
services/web/frontend/stylesheets/bootstrap-5/pages/admin.scss

@@ -0,0 +1,74 @@
+.material-switch {
+  input[type='checkbox'] {
+    display: none;
+
+    &:checked + label::before {
+      background: inherit;
+      opacity: 0.5;
+    }
+
+    &:checked + label::after {
+      background: inherit;
+      left: 20px;
+    }
+
+    &:disabled + label {
+      opacity: 0.5;
+      cursor: not-allowed;
+    }
+  }
+
+  label {
+    cursor: pointer;
+    height: 0;
+    position: relative;
+    width: 40px;
+    background-color: var(--bg-accent-01);
+
+    &::before {
+      background: rgb(0 0 0);
+      box-shadow: inset 0 0 10px rgb(0 0 0 / 50%);
+      border-radius: var(--border-radius-medium);
+      content: '';
+      height: 16px;
+      margin-top: calc(var(--spacing-01) * -1);
+      position: absolute;
+      opacity: 0.3;
+      transition: all 0.2s ease-in-out;
+      width: 40px;
+    }
+
+    &::after {
+      background: rgb(255 255 255);
+      border-radius: var(--border-radius-large);
+      box-shadow: 0 0 5px rgb(0 0 0 / 30%);
+      content: '';
+      height: 24px;
+      left: -4px;
+      margin-top: calc(var(--spacing-01) * -1);
+      position: absolute;
+      top: -4px;
+      transition: all 0.2s ease-in-out;
+      width: 24px;
+    }
+  }
+}
+
+.hr-sect {
+  display: flex;
+  flex-basis: 100%;
+  align-items: center;
+  color: rgb(0 0 0 / 35%);
+  margin: var(--spacing-04) 0;
+}
+
+.hr-sect::before,
+.hr-sect::after {
+  content: '';
+  flex-grow: 1;
+  background: rgb(0 0 0 / 35%);
+  height: 1px;
+  font-size: 0;
+  line-height: 0;
+  margin: 0 var(--spacing-04);
+}

+ 1 - 1
services/web/frontend/stylesheets/bootstrap-5/pages/all.scss

@@ -38,4 +38,4 @@
 @import 'login-register';
 @import 'login-register';
 @import 'login';
 @import 'login';
 @import 'register';
 @import 'register';
-@import 'admin/project-url-lookup';
+@import 'admin';