Skip to content

Commit 38116a4

Browse files
committed
Make span highlighting stand out
1 parent 4698fe5 commit 38116a4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

html-api-debugger/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
}
8080
}
8181

82+
.has-highlighted-span {
83+
box-shadow: 0 0 4px 2px hotpink;
84+
}
85+
8286
.highlight-span {
8387
box-shadow:
8488
0 0 2px 1px hotpink,

html-api-debugger/view.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,12 @@ const store = createStore(NS, {
225225
},
226226
},
227227

228-
/** @param {MouseEvent} e */
229-
handleSpanClear(e) {
230-
/** @type {HTMLElement} */ (
228+
handleSpanClear() {
229+
const el = /** @type {HTMLElement} */ (
231230
document.getElementById('processed-html')
232-
).textContent = store.state.hoverSpan;
231+
);
232+
el.classList.remove('has-highlighted-span');
233+
el.textContent = store.state.hoverSpan;
233234
},
234235

235236
/** @param {MouseEvent} e */
@@ -257,6 +258,7 @@ const store = createStore(NS, {
257258
const el = /** @type {HTMLElement} */ (
258259
document.getElementById('processed-html')
259260
);
261+
el.classList.add('has-highlighted-span');
260262
el.replaceChildren(before, highlightCurrent, after);
261263
},
262264

0 commit comments

Comments
 (0)