reallysimpledocs 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/astro/rehype-basecoat-tables.js +13 -0
- package/src/css/custom.css +3 -3
- package/src/css/styles/luma.css +3 -2
- package/src/css/styles/lyra.css +3 -2
- package/src/css/styles/maia.css +3 -2
- package/src/css/styles/mira.css +3 -2
- package/src/css/styles/nova.css +3 -2
- package/src/css/styles/rhea.css +3 -2
- package/src/css/styles/sera.css +3 -2
- package/src/css/styles/vega.css +3 -2
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ const tableClass = ["table"];
|
|
|
8
8
|
export function rehypeBasecoatTables() {
|
|
9
9
|
return (tree) => {
|
|
10
10
|
transformTables(tree);
|
|
11
|
+
transformCodeBlocks(tree);
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -40,6 +41,18 @@ function transformTables(parent) {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
function transformCodeBlocks(parent) {
|
|
45
|
+
if (!Array.isArray(parent?.children)) return;
|
|
46
|
+
|
|
47
|
+
for (const child of parent.children) {
|
|
48
|
+
if (isElement(child, "pre") && child.children?.some((node) => isElement(node, "code"))) {
|
|
49
|
+
addClass(child, ["scrollbar"]);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
transformCodeBlocks(child);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
function isElement(node, tagName) {
|
|
44
57
|
return node?.type === "element" && node.tagName === tagName;
|
|
45
58
|
}
|
package/src/css/custom.css
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
@apply block min-w-full w-max px-4 py-3 text-[13px];
|
|
48
48
|
}
|
|
49
49
|
pre:has(> code) {
|
|
50
|
-
@apply
|
|
50
|
+
@apply max-w-full overflow-x-auto;
|
|
51
51
|
}
|
|
52
52
|
> blockquote {
|
|
53
53
|
@apply border-l-4 border-border pl-4;
|
|
@@ -177,7 +177,7 @@ html.dark .astro-code span {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.tabs-frame > header {
|
|
180
|
-
@apply flex items-center gap-2 overflow-x-auto rounded-t-[inherit] border-b bg-muted px-3
|
|
180
|
+
@apply flex items-center gap-2 overflow-x-auto rounded-t-[inherit] border-b bg-muted px-3 text-sm font-medium dark:bg-muted/50;
|
|
181
181
|
scrollbar-width: none;
|
|
182
182
|
}
|
|
183
183
|
|
|
@@ -191,7 +191,7 @@ html.dark .astro-code span {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
.code-block > pre {
|
|
194
|
-
@apply
|
|
194
|
+
@apply my-0 max-w-full overflow-x-auto rounded-none border-0;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
.code-block > pre > code {
|
package/src/css/styles/luma.css
CHANGED
package/src/css/styles/lyra.css
CHANGED
package/src/css/styles/maia.css
CHANGED
package/src/css/styles/mira.css
CHANGED
package/src/css/styles/nova.css
CHANGED
package/src/css/styles/rhea.css
CHANGED
package/src/css/styles/sera.css
CHANGED