Skip to content

Commit ff6f321

Browse files
Improve settings spacing
1 parent bec5eb9 commit ff6f321

3 files changed

Lines changed: 60 additions & 53 deletions

File tree

src/view/components/RadioBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface RadioBarProps {
99

1010
export function RadioBar(props: RadioBarProps) {
1111
return (
12-
<div class="radio-bar">
12+
<span class="radio-bar">
1313
{props.items.map(x => {
1414
return (
1515
<label key={x.value}>
@@ -25,6 +25,6 @@ export function RadioBar(props: RadioBarProps) {
2525
</label>
2626
);
2727
})}
28-
</div>
28+
</span>
2929
);
3030
}

src/view/components/devtools.css

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
.checkbox-root {
8888
display: flex;
8989
font-size: 1rem;
90+
padding-bottom: 0.25rem;
9091
}
9192

9293
.checkbox-wrapper {
@@ -97,10 +98,6 @@
9798
align-items: center;
9899
}
99100

100-
.checkbox-wrapper svg {
101-
width: 1.25rem;
102-
}
103-
104101
.checkbox-wrapper input {
105102
opacity: 0;
106103
position: absolute;
@@ -1081,24 +1078,19 @@
10811078
* Settings tab
10821079
*/
10831080
.settings-tab {
1084-
padding: 1rem;
1085-
}
1086-
1087-
.settings-tab-label {
1088-
display: block;
1089-
margin-bottom: 0.75rem;
1090-
font-size: 0.9rem;
1081+
padding: 1rem 0.8rem;
10911082
}
10921083

10931084
.settings-tab h2 {
1094-
margin-top: 3rem;
1095-
font-size: 2rem;
1085+
margin-top: 1.4rem;
1086+
margin-bottom: 1rem;
1087+
font-size: 1rem;
10961088
font-weight: lighter;
10971089
}
10981090

10991091
.settings-tab-message {
11001092
margin-left: 1.25rem;
1101-
margin-top: 0.5rem;
1093+
margin-top: 0.25rem;
11021094
margin-bottom: 2rem;
11031095
}
11041096

@@ -1108,7 +1100,17 @@
11081100

11091101
.settings-tab-description {
11101102
margin-left: 1.25rem;
1111-
margin-top: 0.25rem !important;
1112-
margin-bottom: 2rem;
1113-
font-size: 0.9rem;
1103+
margin-top: 0.25rem;
1104+
font-size: var(--font-xnormal);
1105+
}
1106+
1107+
.settings-checkbox-setting {
1108+
margin-bottom: 1rem;
1109+
}
1110+
1111+
.settings-tab-label {
1112+
display: inline-block;
1113+
margin-bottom: 0.75rem;
1114+
font-size: var(--font-xnormal);
1115+
margin-right: 0.6rem;
11141116
}

src/view/components/settings/Settings.tsx

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,46 @@ export function Settings() {
2020
<PageLayout>
2121
<div class="settings-tab">
2222
<form>
23-
<Checkbox
24-
checked={highlightUpdates}
25-
onChange={() => {
26-
const value = !store.profiler.highlightUpdates.value;
27-
store.profiler.highlightUpdates.value = value;
28-
store.notify(
29-
value ? "start-highlight-updates" : "stop-highlight-updates",
30-
null,
31-
);
32-
}}
33-
testId="toggle-highlight-updates"
34-
>
35-
Highlight updates
36-
</Checkbox>
37-
<div>
38-
<p class="settings-tab-description">
39-
Visualize updates by highlighting each component that updated in
40-
the page.
41-
</p>
23+
<div class="settings-checkbox-setting">
24+
<Checkbox
25+
checked={highlightUpdates}
26+
onChange={() => {
27+
const value = !store.profiler.highlightUpdates.value;
28+
store.profiler.highlightUpdates.value = value;
29+
store.notify(
30+
value ? "start-highlight-updates" : "stop-highlight-updates",
31+
null,
32+
);
33+
}}
34+
testId="toggle-highlight-updates"
35+
>
36+
Highlight updates
37+
</Checkbox>
38+
<div>
39+
<p class="settings-tab-description">
40+
Visualize updates by highlighting each component that updated in
41+
the page.
42+
</p>
43+
</div>
4244
</div>
43-
<Checkbox
44-
checked={renderReasons}
45-
onChange={() =>
46-
store.profiler.setRenderReasonCapture(!renderReasons)
47-
}
48-
testId="toggle-render-reason"
49-
>
50-
Capture render reasons
51-
</Checkbox>
52-
<div class="settings-tab-message">
53-
<Message type="info">
54-
All props, state, and hooks of the current node will be compared
55-
to the previous node to determine what changed between renders.
56-
Timings may be less accurate because of that.
57-
</Message>
45+
<div class="settings-checkbox-setting">
46+
<Checkbox
47+
checked={renderReasons}
48+
onChange={() =>
49+
store.profiler.setRenderReasonCapture(!renderReasons)
50+
}
51+
testId="toggle-render-reason"
52+
>
53+
Capture render reasons
54+
</Checkbox>
55+
56+
<div class="settings-tab-message">
57+
<Message type="info">
58+
All props, state, and hooks of the current node will be compared
59+
to the previous node to determine what changed between renders.
60+
Timings may be less accurate because of that.
61+
</Message>
62+
</div>
5863
</div>
5964

6065
<label class="settings-tab-label">Theme:</label>

0 commit comments

Comments
 (0)