Skip to content

Commit 5bbea58

Browse files
committed
Docs: Adjustments to code editing
- When entering edit mode, scroll element to center. - Hide swatches in edit mode and round editor top. - Scroll results to center on run/cancel.
1 parent 3da7031 commit 5bbea58

File tree

9 files changed

+15
-8
lines changed

9 files changed

+15
-8
lines changed

docs/src/js/extra-notebook.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ ${content}
412412
buttonShare.classList.toggle("hidden")
413413
editor.setValue(editor.getValue())
414414
editor.focus()
415+
pg.scrollIntoView({behavior: "smooth", block: 'center', inline: 'nearest'})
415416
})
416417

417418
buttonShare.addEventListener("click", async() => {
@@ -473,6 +474,7 @@ ${content}
473474
buttonCancel.classList.toggle("hidden")
474475
delete editTemp[currentID]
475476
busy = false
477+
pg.scrollIntoView({behavior: "smooth", block: 'center', inline: 'nearest'})
476478
})
477479

478480
buttonCancel.addEventListener("click", () => {
@@ -486,6 +488,7 @@ ${content}
486488
buttonShare.classList.toggle("hidden")
487489
buttonRun.classList.toggle("hidden")
488490
buttonCancel.classList.toggle("hidden")
491+
pg.scrollIntoView({behavior: "smooth", block: 'center', inline: 'nearest'})
489492
})
490493
})
491494
}

docs/src/scss/_playground.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ div.playground {
181181
width: 100%;
182182
height: 100%;
183183
overflow: hidden;
184+
border-top-left-radius: convert.px2rem(9.6px);
185+
border-top-right-radius: convert.px2rem(9.6px);
184186
}
185187

186188
.playground-code .highlight code {
@@ -223,6 +225,8 @@ div.playground {
223225

224226
.playground-code:not(.hidden) div.highlight ,
225227
.hidden .highlight,
228+
.hidden .swatch-bar,
229+
.hidden .color-wheel,
226230
.hidden .playground-inputs {
227231
display: none;
228232
}

docs/theme/assets/coloraide-extras/extra-ebf3a98f4d.css renamed to docs/theme/assets/coloraide-extras/extra-76e8091b4a.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/theme/assets/coloraide-extras/extra-76e8091b4a.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/theme/assets/coloraide-extras/extra-ebf3a98f4d.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/theme/assets/coloraide-extras/extra-notebook-CKvB0eua.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/theme/assets/coloraide-extras/extra-notebook-CKvB0eua.js renamed to docs/theme/assets/coloraide-extras/extra-notebook-qvRCIPPc.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/theme/assets/coloraide-extras/extra-notebook-qvRCIPPc.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zensical.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ markdown_extensions:
341341

342342
extra_css:
343343
- assets/pymdownx-extras/extra-0a1087787d.css
344-
- assets/coloraide-extras/extra-ebf3a98f4d.css
344+
- assets/coloraide-extras/extra-76e8091b4a.css
345345
- https://cdn.jsdelivr.net/npm/[email protected]/css/ace.css
346346
extra_javascript:
347347
- assets/pymdownx-extras/extra-loader-Ccztcqfq.js
348348
- https://cdn.jsdelivr.net/npm/[email protected]/src-min-noconflict/ace.js
349349
- https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js
350350
- playground-config-21defe50.js
351351
- https://cdn.jsdelivr.net/pyodide/v0.29.0/full/pyodide.js
352-
- assets/coloraide-extras/extra-notebook-CKvB0eua.js
352+
- assets/coloraide-extras/extra-notebook-qvRCIPPc.js
353353
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
354354

355355
extra:

0 commit comments

Comments
 (0)