From aafd6eed82f0fb7cfb39ba472016cf4509ae8161 Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:48:50 +0100 Subject: [PATCH] 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 --- .../bootstrap-5/abstracts/mixins.scss | 30 ++++++++ .../bootstrap-5/components/form.scss | 18 +++++ .../stylesheets/bootstrap-5/pages/admin.scss | 74 +++++++++++++++++++ .../stylesheets/bootstrap-5/pages/all.scss | 2 +- 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 services/web/frontend/stylesheets/bootstrap-5/pages/admin.scss diff --git a/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss b/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss index e94d955f49..b35dec6212 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss @@ -174,3 +174,33 @@ 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; + } +} diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/form.scss b/services/web/frontend/stylesheets/bootstrap-5/components/form.scss index ebed74c410..b4897bad1c 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/components/form.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/components/form.scss @@ -223,3 +223,21 @@ border-color: $input-focus-border-color; 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); +} diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/admin.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/admin.scss new file mode 100644 index 0000000000..c34ed4b771 --- /dev/null +++ b/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); +} diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss index 85df16d7a4..682f292cc3 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss @@ -38,4 +38,4 @@ @import 'login-register'; @import 'login'; @import 'register'; -@import 'admin/project-url-lookup'; +@import 'admin';