Skip to content

Commit bc1d9e5

Browse files
committedOct 24, 2023
Refactor more docs
1 parent 0d1558a commit bc1d9e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2301
-2246
lines changed
 

Diff for: ‎docs/_asset/editor.jsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ const grammars = [
9393
/** @type {Awaited<ReturnType<typeof createStarryNight>>} */
9494
let starryNight
9595

96-
const body = document.querySelector('.body')
96+
const editor = document.querySelector('#js-editor')
9797

98-
if (body && window.location.pathname === '/playground/') {
98+
if (window.location.pathname === '/playground/' && editor) {
9999
const root = document.createElement('div')
100100
root.classList.add('playground')
101-
body.after(root)
101+
editor.after(root)
102102
init(root)
103103
}
104104

@@ -204,7 +204,10 @@ function Playground() {
204204

205205
if (show === 'result') {
206206
/** @type {MDXModule} */
207-
const mod = await run(String(file), runtime)
207+
const mod = await run(String(file), {
208+
...runtime,
209+
baseUrl: window.location.href
210+
})
208211

209212
return (
210213
<ErrorBoundary FallbackComponent={ErrorFallback}>

Diff for: ‎docs/_asset/index.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ hr {
331331
table {
332332
border-collapse: collapse;
333333
border-spacing: 0;
334-
display: block;
335334
overflow: auto;
336335
width: 100%;
337336
font-variant-numeric: lining-nums;
@@ -539,6 +538,16 @@ button.success {
539538
);
540539
}
541540

541+
.full-bleed {
542+
width: 100vw;
543+
position: relative;
544+
left: 50%;
545+
right: 50%;
546+
margin-left: -50vw;
547+
margin-right: -50vw;
548+
padding-inline: calc(1em + 1ex);
549+
}
550+
542551
/* Note that the `backdrop-filter` itself is applied in light mode. */
543552
@supports (backdrop-filter: blur(1ex)) {
544553
.navigation::before {
@@ -1224,7 +1233,6 @@ details[open] {
12241233
grid-template-columns: 49% 49%;
12251234
min-height: 40rem;
12261235
gap: calc(1em + 1ex);
1227-
margin-inline: calc(1em + 1ex);
12281236
}
12291237

12301238
.playground-area,

0 commit comments

Comments
 (0)