Skip to content

Commit 653d9bb

Browse files
authored
chore: polish style (#359)
1 parent e9292e6 commit 653d9bb

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

website/theme/components/Playground/ResultPanel.css

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
font-size: 12px;
162162
}
163163
.ast-node-row:hover {
164-
background: #f6f8fa;
164+
background: #f3f4f6;
165165
}
166166
.ast-node-row.selected {
167167
background: #e7f3ff;
@@ -173,7 +173,7 @@
173173
height: 0;
174174
border-top: 5px solid transparent;
175175
border-bottom: 5px solid transparent;
176-
border-left: 6px solid #57606a;
176+
border-left: 6px solid #8c959f;
177177
background: transparent;
178178
padding: 0;
179179
margin-right: 2px;
@@ -182,29 +182,26 @@
182182
.twisty.open {
183183
transform: rotate(90deg);
184184
}
185-
.twisty.placeholder {
186-
width: 10px;
187-
height: 10px;
188-
border: none;
189-
}
185+
/* no placeholder for twisty when no children */
190186

191187
.node-type {
192188
font-weight: 600;
193-
color: #24292f;
189+
color: #1f6feb;
194190
}
195191
.node-range {
196-
color: #57606a;
192+
color: #8c959f;
197193
font-family:
198194
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
199195
'Courier New', monospace;
200196
}
201197
.node-preview {
202-
color: #6e7781;
198+
color: #8c959f;
203199
margin-left: 6px;
200+
font-style: italic;
204201
}
205202

206203
.ast-children {
207-
margin-left: 14px;
204+
margin-left: 10px;
208205
}
209206

210207
.ast-content {

website/theme/components/Playground/ResultPanel.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ export const ResultPanel: React.FC<ResultPanelProps> = props => {
141141
const hasKids = isExpandable(n);
142142
const preview = n.text ? n.text.replace(/\s+/g, ' ').slice(0, 40) : '';
143143
return (
144-
<div key={id} className="ast-node" style={{ paddingLeft: depth * 14 }}>
144+
<div key={id} className="ast-node" style={{ paddingLeft: depth * 2 }}>
145145
<div
146146
className={`ast-node-row ${selectedId === id ? 'selected' : ''}`}
147147
onClick={() => clickNode(n)}
148148
>
149-
{hasKids ? (
149+
{hasKids && (
150150
<button
151151
className={`twisty ${open ? 'open' : ''}`}
152152
onClick={e => {
@@ -155,8 +155,6 @@ export const ResultPanel: React.FC<ResultPanelProps> = props => {
155155
}}
156156
aria-label={open ? 'Collapse' : 'Expand'}
157157
/>
158-
) : (
159-
<span className="twisty placeholder" />
160158
)}
161159
<span className="node-type">{n.type}</span>
162160
<span className="node-range">

0 commit comments

Comments
 (0)