Skip to content

Commit 09fa2d2

Browse files
committed
Cleaned up dark mode styles inc. setting browser color scheme
Forces browser colorscheme based on BookStack color scheme, via 'color-scheme' css property. Sets proper dark mode colors for some previously missed areas like templates and attachment control buttons. Also fixed search bar icon position for some search inputs.
1 parent b786ed0 commit 09fa2d2

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

resources/sass/_blocks.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
}
110110

111111
.card.border-card {
112-
border: 1px solid #DDD;
112+
border: 1px solid;
113+
@include lightDark(border-color, #ddd, #000);
113114
}
114115

115116
.card.drag-card {
@@ -133,7 +134,7 @@
133134
flex-grow: 0;
134135
padding: 0 $-xs;
135136
&:hover {
136-
background-color: #EEE;
137+
@include lightDark(background-color, #eee, #2d2d2d);
137138
}
138139
.svg-icon {
139140
margin-inline-end: 0px;

resources/sass/_components.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,14 +812,16 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
812812
height: 100%;
813813
display: flex;
814814
flex-direction: column;
815-
border-inline-start: 1px solid #DDD;
815+
border-inline-start: 1px solid;
816+
@include lightDark(border-color, #ddd, #000);
816817
}
817818
.template-item-actions button {
818819
cursor: pointer;
819820
flex: 1;
820-
background: #FFF;
821+
@include lightDark(background-color, #FFF, #222);
821822
border: 0;
822-
border-top: 1px solid #DDD;
823+
border-top: 1px solid;
824+
@include lightDark(border-color, #DDD, #000);
823825
}
824826
.template-item-actions button svg {
825827
margin: 0;

resources/sass/_lists.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@
284284
padding-inline-start: $-m;
285285
}
286286
li {
287-
border: 1px solid #DDD;
287+
border: 1px solid;
288+
@include lightDark(border-color, #DDD, #666);
288289
margin-top: -1px;
289290
min-height: 38px;
290291
}

resources/sass/_variables.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ $fs-s: 12px;
5151

5252
:root.dark-mode {
5353
--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(255, 255, 255,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E");
54+
color-scheme: only dark;
55+
}
56+
:root:not(.dark-mode) {
57+
color-scheme: only light;
5458
}
5559

5660
$positive: #0f7d15;

resources/views/entities/search-form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<form refs="entity-search@searchForm" class="search-box flexible" role="search">
66
<input refs="entity-search@searchInput" type="text"
77
aria-label="{{ $label }}" name="term" placeholder="{{ $label }}">
8-
<button type="submit" aria-label="{{ trans('common.search') }}">@icon('search')</button>
8+
<button tabindex="-1" type="submit" aria-label="{{ trans('common.search') }}">@icon('search')</button>
99
</form>
1010
</div>

resources/views/pages/parts/template-manager.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<div class="search-box flexible mb-m" style="display: {{ count($templates) > 0 ? 'block' : 'none' }}">
1515
<input refs="template-manager@searchInput" type="text" name="template-search" placeholder="{{ trans('common.search') }}">
16-
<button refs="template-manager@searchButton" type="button">@icon('search')</button>
16+
<button refs="template-manager@searchButton" tabindex="-1" type="button">@icon('search')</button>
1717
<button refs="template-manager@searchCancel" class="search-box-cancel text-neg" type="button" style="display: none">@icon('close')</button>
1818
</div>
1919

0 commit comments

Comments
 (0)