Skip to content

Commit 9ce3ea2

Browse files
committed
Make dialog and sprites dark-mode compatible
1 parent cff00f9 commit 9ce3ea2

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

sox.css

+7-9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
#sox-settings-dialog #search-container {
3636
min-height: 0;
37+
width: 570px;
38+
left: 10px;
3739
}
3840

3941
#sox-settings-dialog #search-container .sox-sprite-search {
@@ -53,8 +55,7 @@
5355
}
5456

5557
#sox-settings-dialog #search-container #search {
56-
width: 490px;
57-
text-indent: 20px;
58+
max-width: 90%;
5859
}
5960

6061
#sox-settings-dialog-features {
@@ -69,7 +70,7 @@
6970
}
7071

7172
#sox-settings-dialog-features .modal-content div:hover {
72-
background-color: #f7f8f8;
73+
background-color: var(--black-075);
7374
}
7475

7576
#sox-settings-dialog-features .modal-content label>input {
@@ -88,7 +89,7 @@
8889

8990
#sox-settings-dialog-actions .action {
9091
float: right;
91-
padding: 11px;
92+
padding: 13px 11px;
9293
}
9394

9495
#sox-settings-dialog .sox-new-version-item {
@@ -108,10 +109,6 @@
108109
height: 24px !important;
109110
}
110111

111-
.sox-settings-button:hover {
112-
color: #999;
113-
}
114-
115112
#sox-settings-dialog-check-toggle>i {
116113
padding: 14px 0;
117114
}
@@ -127,7 +124,7 @@
127124

128125
.sox-feature-info,
129126
.sox-feature-settings {
130-
background-color: whitesmoke;
127+
background-color: var(--black-025);
131128
border-radius: 9px;
132129
margin-left: 20px;
133130
padding: 8px;
@@ -169,6 +166,7 @@
169166
padding: 10px;
170167
border-radius: 9px;
171168
background-color: lightgrey;
169+
color: #3c4146; /* dark mode compatibility */
172170
cursor: pointer;
173171
}
174172

sox.dialog.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ <h3>
77
<div class="header">
88
<h3>search</h3>
99
</div>
10-
<div class="modal-content" id="search-container">
11-
<input type="text" id="search" placeholder="looking for a specific feature?">
12-
<svg role="img" title="delete" class="sox-sprite sox-sprite-search"> <use xlink:href="#sox_search"> </use> </svg>
10+
<div class="grid--cell ps-relative fl1 modal-content" id="search-container">
11+
<input class="s-input s-input__search js-search-field" type="text" placeholder="looking for a feature?" id="search">
12+
<svg xmlns="http://www.w3.org/2000/svg" class="svg-icon s-input-icon s-input-icon__search iconSearch" aria-hidden="true" viewBox="0 0 18 18" width="18" height="18"><path d="M 18 16.5 l -5.14 -5.18 h -0.35 a 7 7 0 1 0 -1.19 1.19 v 0.35 L 16.5 18 l 1.5 -1.5 Z M 12 7 A 5 5 0 1 1 2 7 a 5 5 0 0 1 10 0 Z" /></svg>
1313
</div>
1414
<div id="sox-settings-dialog-features">
1515
<div id="sox-settings-dialog-features-packs">
@@ -25,10 +25,10 @@ <h3>Feature Packs</h3>
2525
</div>
2626
</div>
2727
<div id="sox-settings-dialog-actions">
28-
<input id="sox-settings-dialog-save" type="submit" value="Save Changes">
29-
<a class="action" id="sox-settings-dialog-reset" title="reset SOX (deletes everything, including your settings and access token)">Reset</a>
30-
<a class="action" id="sox-settings-dialog-report" title="report issue on Github" target="_blank" href="https://github.com/soscripted/sox/issues/new">Report Issue</a>
31-
<a class="action" id="sox-settings-dialog-debugging">Enable Debugging</a>
28+
<input class="s-btn s-btn__primary s-btn__sm" id="sox-settings-dialog-save" type="submit" value="Save Changes">
29+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-reset" title="reset SOX (deletes everything, including your settings and access token)">Reset</a>
30+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-report" title="report issue on Github" target="_blank" href="https://github.com/soscripted/sox/issues/new">Report Issue</a>
31+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-debugging">Enable Debugging</a>
3232
<a class="action" id="sox-settings-dialog-access-token" title="request a new access token">
3333
<svg role="img" class="sox-sprite sox-sprite-key"> <use xlink:href="#sox_key"> </use> </svg>
3434
</a>

sox.dialog.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
const $label = $('<label/>');
7777
const $input = $('<input/>', {
7878
id: name,
79+
class: 's-checkbox',
7980
type: 'checkbox',
8081
}).prop('disabled', blockFeatureSelection);
8182

@@ -89,7 +90,7 @@
8990
if (featureSettings) {
9091
const $settingsDiv = $('<div/>', {
9192
id: 'feature-settings-' + name,
92-
'class': 'sox-feature-settings',
93+
class: 'sox-feature-settings',
9394
style: 'display: none; margin-top: 5px;',
9495
});
9596

@@ -110,19 +111,20 @@
110111
for (let i = 0; i < featureSettings.length; i++) {
111112
const currentSetting = featureSettings[i];
112113
$settingsDiv
113-
.append(currentSetting.desc)
114-
.append('<br>')
115114
.append(sox.helpers.newElement(currentSetting.type, { //use newElement helper so the type can be things like 'checkbox' or 'radio'
116115
id: currentSetting.id,
117-
'class': 'featureSetting',
116+
'class': currentSetting.type === 'textarea' ? 'featureSetting s-input' : 'featureSetting s-checkbox',
117+
'style': 'margin-right: 5px',
118118
'checked': (currentSetting.type === 'checkbox' ? JSON.parse(optionalSettings)[currentSetting.id] : false),
119119
value: (optionalSettings === -1 ? '' : JSON.parse(optionalSettings)[currentSetting.id]),
120120
}))
121+
.append(currentSetting.desc)
121122
.append('<br>');
122123
}
123124

124125
const $saveFeatureSettings = $('<a/>', {
125126
id: 'saveSettings-' + name,
127+
class: 'action s-btn s-btn__secondary s-btn__sm',
126128
text: 'Save Settings',
127129
click: function(e) {
128130
e.preventDefault(); //don't uncheck the checkbox

sox.sprites.svg

+11-11
Loading

0 commit comments

Comments
 (0)