From 4283da262d64d60bdef1404efe801ba53c47db2e Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sun, 20 Apr 2025 12:33:40 -0500 Subject: [PATCH] Fix Bootstrap 5 diff view layout and form control border color in dark themes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Improve diff view layout using flexbox to make selectors fill available space - Add proper vertical alignment and spacing in the toolbar - Adjust form control border colors in dark themes using CSS variables - Fix border color contrast issues in dark themes This addresses two issues reported in PR #7582: - Fixes diff view toolbar sizing and layout - Fixes combobox turning white on compiler change in diff view 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- static/styles/themes/dark-theme.scss | 8 ++++++++ static/styles/themes/one-dark-theme.scss | 8 ++++++++ static/styles/themes/pink-theme.scss | 8 ++++++++ views/templates/panes/diff.pug | 10 +++++----- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/static/styles/themes/dark-theme.scss b/static/styles/themes/dark-theme.scss index 6b66dcaf4..b9df66f29 100644 --- a/static/styles/themes/dark-theme.scss +++ b/static/styles/themes/dark-theme.scss @@ -28,6 +28,14 @@ body { background-color: #333 !important; } +// Border color adjustments for form elements in dark theme +.form-select, +.form-control, +.input-group-text, +.ts-wrapper .ts-control { + --bs-border-color: #444; +} + input, textarea { color: #eee !important; diff --git a/static/styles/themes/one-dark-theme.scss b/static/styles/themes/one-dark-theme.scss index ef88aec94..d36ef9fa9 100644 --- a/static/styles/themes/one-dark-theme.scss +++ b/static/styles/themes/one-dark-theme.scss @@ -39,6 +39,14 @@ body { background-color: $base !important; } +// Border color adjustments for form elements in dark theme +.form-select, +.form-control, +.input-group-text, +.ts-wrapper .ts-control { + --bs-border-color: $dark; +} + input { color: #eee !important; background-color: $lighter; diff --git a/static/styles/themes/pink-theme.scss b/static/styles/themes/pink-theme.scss index a871216c9..083247fa7 100644 --- a/static/styles/themes/pink-theme.scss +++ b/static/styles/themes/pink-theme.scss @@ -36,6 +36,14 @@ body { background-color: $base !important; } +// Border color adjustments for form elements +.form-select, +.form-control, +.input-group-text, +.ts-wrapper .ts-control { + --bs-border-color: $dark; +} + input { //color: #000 !important; background-color: $base; diff --git a/views/templates/panes/diff.pug b/views/templates/panes/diff.pug index 79dec225d..50f00e91b 100644 --- a/views/templates/panes/diff.pug +++ b/views/templates/panes/diff.pug @@ -1,14 +1,14 @@ #diff - .top-bar.btn-toolbar.bg-light(role="toolbar") + .top-bar.btn-toolbar.bg-light.py-1.d-flex.align-items-center(role="toolbar") include ../../font-size - .btn-group.btn-group-sm - .input-group.input-group-sm.mb-auto + .btn-group.btn-group-sm.flex-grow-1.me-2 + .input-group.input-group-sm.w-100 label.input-group-text | Left:  select.form-select.diff-picker.lhs(placeholder="Select compiler...") select.form-select.difftype-picker.lhsdifftype(placeholder="...") - .btn-group.btn-group-sm.ms-4 - .input-group.input-group-sm.mb-auto + .btn-group.btn-group-sm.flex-grow-1 + .input-group.input-group-sm.w-100 label.input-group-text | Right:  select.form-select.diff-picker.rhs(placeholder="Select compiler...")