@ox-content/vite-plugin 3.0.0-alpha.12 → 3.0.0-alpha.14

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.
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.markdownTableScrollLabel = markdownTableScrollLabel;
4
+ exports.enhanceMarkdownTables = enhanceMarkdownTables;
5
+ const TABINDEX_FLAG = "oxTableScrollTabindex";
6
+ const LABEL_FLAG = "oxTableScrollLabel";
7
+ const SCROLLABLE_ATTR = "data-ox-table-scrollable";
8
+ function markdownTableScrollLabel(locale) {
9
+ const language = locale?.split("-")[0]?.toLowerCase();
10
+ if (language === "ja") {
11
+ return "横スクロールできる表";
12
+ }
13
+ return "Scrollable table";
14
+ }
15
+ /**
16
+ * Makes overflowing Markdown tables keyboard-scrollable without wrapping or
17
+ * replacing the native `<table>` element.
18
+ *
19
+ * Run this after rendering Markdown and again after layout-changing updates.
20
+ * Narrow tables stay out of the tab order when overflow can be measured.
21
+ */
22
+ function enhanceMarkdownTables(root, options = {}) {
23
+ const target = root ?? globalThis.document;
24
+ if (!target?.querySelectorAll) {
25
+ return 0;
26
+ }
27
+ const selector = options.selector ?? ".content table";
28
+ const locale = ownerDocument(target)?.documentElement.lang;
29
+ const label = options.label ?? markdownTableScrollLabel(locale);
30
+ let scrollableCount = 0;
31
+ for (const table of target.querySelectorAll(selector)) {
32
+ if (typeof HTMLElement === "undefined" || !(table instanceof HTMLElement)) {
33
+ continue;
34
+ }
35
+ if (table.tagName !== "TABLE") {
36
+ continue;
37
+ }
38
+ const scrollable = table.scrollWidth > table.clientWidth + 1;
39
+ table.toggleAttribute(SCROLLABLE_ATTR, scrollable);
40
+ if (scrollable) {
41
+ scrollableCount++;
42
+ if (!table.hasAttribute("tabindex")) {
43
+ table.tabIndex = 0;
44
+ table.dataset[TABINDEX_FLAG] = "true";
45
+ }
46
+ if (!table.hasAttribute("aria-label") && !table.hasAttribute("aria-labelledby")) {
47
+ table.setAttribute("aria-label", label);
48
+ table.dataset[LABEL_FLAG] = "true";
49
+ }
50
+ }
51
+ else {
52
+ if (table.dataset[TABINDEX_FLAG] === "true") {
53
+ table.removeAttribute("tabindex");
54
+ delete table.dataset[TABINDEX_FLAG];
55
+ }
56
+ if (table.dataset[LABEL_FLAG] === "true") {
57
+ table.removeAttribute("aria-label");
58
+ delete table.dataset[LABEL_FLAG];
59
+ }
60
+ }
61
+ }
62
+ return scrollableCount;
63
+ }
64
+ function ownerDocument(root) {
65
+ if (typeof Document !== "undefined" && root instanceof Document) {
66
+ return root;
67
+ }
68
+ return root.ownerDocument ?? globalThis.document;
69
+ }
70
+ //# sourceMappingURL=markdown-tables.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-tables.cjs","sourceRoot":"","sources":["../../../../home/runner/work/ox-content/ox-content/npm/vite-plugin-ox-content/src/markdown-tables.ts"],"names":[],"mappings":";;;;AAaA,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAC9C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD,kCAAyC,MAAe;IACtD,MAAM,QAAQ,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED;;;;;;GAMG;AACH,+BACE,IAAiB,EACjB,OAAO,GAAoC,EAAE;IAE7C,MAAM,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,gBAA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AAC,UAAU,CAAC,CAAC;gBAClC,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,MAAM,EAAE,CAAC;gBACzC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;gBACpC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,SAAS,aAAa,CAAC,IAAgB;IACrC,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,IAAI,YAAY,QAAQ,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,CAAC;AACnD,CAAC","sourcesContent":["export interface MarkdownTableEnhancementOptions {\n /**\n * Tables to enhance. Defaults to Markdown content tables styled by\n * `@ox-content/vite-plugin/styles/core.css`.\n */\n selector?: string;\n /**\n * Accessible name applied only when an overflowing table has no existing\n * `aria-label` or `aria-labelledby`.\n */\n label?: string;\n}\n\nconst TABINDEX_FLAG = \"oxTableScrollTabindex\";\nconst LABEL_FLAG = \"oxTableScrollLabel\";\nconst SCROLLABLE_ATTR = \"data-ox-table-scrollable\";\n\nexport function markdownTableScrollLabel(locale?: string): string {\n const language = locale?.split(\"-\")[0]?.toLowerCase();\n if (language === \"ja\") {\n return \"横スクロールできる表\";\n }\n return \"Scrollable table\";\n}\n\n/**\n * Makes overflowing Markdown tables keyboard-scrollable without wrapping or\n * replacing the native `<table>` element.\n *\n * Run this after rendering Markdown and again after layout-changing updates.\n * Narrow tables stay out of the tab order when overflow can be measured.\n */\nexport function enhanceMarkdownTables(\n root?: ParentNode,\n options: MarkdownTableEnhancementOptions = {},\n): number {\n const target = root ?? globalThis.document;\n if (!target?.querySelectorAll) {\n return 0;\n }\n\n const selector = options.selector ?? \".content table\";\n const locale = ownerDocument(target)?.documentElement.lang;\n const label = options.label ?? markdownTableScrollLabel(locale);\n let scrollableCount = 0;\n\n for (const table of target.querySelectorAll(selector)) {\n if (typeof HTMLElement === \"undefined\" || !(table instanceof HTMLElement)) {\n continue;\n }\n if (table.tagName !== \"TABLE\") {\n continue;\n }\n\n const scrollable = table.scrollWidth > table.clientWidth + 1;\n table.toggleAttribute(SCROLLABLE_ATTR, scrollable);\n if (scrollable) {\n scrollableCount++;\n if (!table.hasAttribute(\"tabindex\")) {\n table.tabIndex = 0;\n table.dataset[TABINDEX_FLAG] = \"true\";\n }\n if (!table.hasAttribute(\"aria-label\") && !table.hasAttribute(\"aria-labelledby\")) {\n table.setAttribute(\"aria-label\", label);\n table.dataset[LABEL_FLAG] = \"true\";\n }\n } else {\n if (table.dataset[TABINDEX_FLAG] === \"true\") {\n table.removeAttribute(\"tabindex\");\n delete table.dataset[TABINDEX_FLAG];\n }\n if (table.dataset[LABEL_FLAG] === \"true\") {\n table.removeAttribute(\"aria-label\");\n delete table.dataset[LABEL_FLAG];\n }\n }\n }\n\n return scrollableCount;\n}\n\nfunction ownerDocument(root: ParentNode): Document | undefined {\n if (typeof Document !== \"undefined\" && root instanceof Document) {\n return root;\n }\n return root.ownerDocument ?? globalThis.document;\n}\n"]}
@@ -0,0 +1,25 @@
1
+ //#region src/markdown-tables.d.ts
2
+ interface MarkdownTableEnhancementOptions {
3
+ /**
4
+ * Tables to enhance. Defaults to Markdown content tables styled by
5
+ * `@ox-content/vite-plugin/styles/core.css`.
6
+ */
7
+ selector?: string;
8
+ /**
9
+ * Accessible name applied only when an overflowing table has no existing
10
+ * `aria-label` or `aria-labelledby`.
11
+ */
12
+ label?: string;
13
+ }
14
+ declare function markdownTableScrollLabel(locale?: string): string;
15
+ /**
16
+ * Makes overflowing Markdown tables keyboard-scrollable without wrapping or
17
+ * replacing the native `<table>` element.
18
+ *
19
+ * Run this after rendering Markdown and again after layout-changing updates.
20
+ * Narrow tables stay out of the tab order when overflow can be measured.
21
+ */
22
+ declare function enhanceMarkdownTables(root?: ParentNode, options?: MarkdownTableEnhancementOptions): number;
23
+ //#endregion
24
+ export { MarkdownTableEnhancementOptions, enhanceMarkdownTables, markdownTableScrollLabel };
25
+ //# sourceMappingURL=markdown-tables.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-tables.d.cts","names":[],"sources":["../src/markdown-tables.ts"],"mappings":";UAAiB;;;;;EAKf;;;;;EAKA;;iBAOc,yBAAyB;;;;;;;;iBAezB,sBACd,OAAO,YACP,UAAS"}
@@ -0,0 +1,25 @@
1
+ //#region src/markdown-tables.d.ts
2
+ interface MarkdownTableEnhancementOptions {
3
+ /**
4
+ * Tables to enhance. Defaults to Markdown content tables styled by
5
+ * `@ox-content/vite-plugin/styles/core.css`.
6
+ */
7
+ selector?: string;
8
+ /**
9
+ * Accessible name applied only when an overflowing table has no existing
10
+ * `aria-label` or `aria-labelledby`.
11
+ */
12
+ label?: string;
13
+ }
14
+ declare function markdownTableScrollLabel(locale?: string): string;
15
+ /**
16
+ * Makes overflowing Markdown tables keyboard-scrollable without wrapping or
17
+ * replacing the native `<table>` element.
18
+ *
19
+ * Run this after rendering Markdown and again after layout-changing updates.
20
+ * Narrow tables stay out of the tab order when overflow can be measured.
21
+ */
22
+ declare function enhanceMarkdownTables(root?: ParentNode, options?: MarkdownTableEnhancementOptions): number;
23
+ //#endregion
24
+ export { MarkdownTableEnhancementOptions, enhanceMarkdownTables, markdownTableScrollLabel };
25
+ //# sourceMappingURL=markdown-tables.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-tables.d.mts","names":[],"sources":["../src/markdown-tables.ts"],"mappings":";UAAiB;;;;;EAKf;;;;;EAKA;;iBAOc,yBAAyB;;;;;;;;iBAezB,sBACd,OAAO,YACP,UAAS"}
@@ -0,0 +1,66 @@
1
+ const TABINDEX_FLAG = "oxTableScrollTabindex";
2
+ const LABEL_FLAG = "oxTableScrollLabel";
3
+ const SCROLLABLE_ATTR = "data-ox-table-scrollable";
4
+ export function markdownTableScrollLabel(locale) {
5
+ const language = locale?.split("-")[0]?.toLowerCase();
6
+ if (language === "ja") {
7
+ return "横スクロールできる表";
8
+ }
9
+ return "Scrollable table";
10
+ }
11
+ /**
12
+ * Makes overflowing Markdown tables keyboard-scrollable without wrapping or
13
+ * replacing the native `<table>` element.
14
+ *
15
+ * Run this after rendering Markdown and again after layout-changing updates.
16
+ * Narrow tables stay out of the tab order when overflow can be measured.
17
+ */
18
+ export function enhanceMarkdownTables(root, options = {}) {
19
+ const target = root ?? globalThis.document;
20
+ if (!target?.querySelectorAll) {
21
+ return 0;
22
+ }
23
+ const selector = options.selector ?? ".content table";
24
+ const locale = ownerDocument(target)?.documentElement.lang;
25
+ const label = options.label ?? markdownTableScrollLabel(locale);
26
+ let scrollableCount = 0;
27
+ for (const table of target.querySelectorAll(selector)) {
28
+ if (typeof HTMLElement === "undefined" || !(table instanceof HTMLElement)) {
29
+ continue;
30
+ }
31
+ if (table.tagName !== "TABLE") {
32
+ continue;
33
+ }
34
+ const scrollable = table.scrollWidth > table.clientWidth + 1;
35
+ table.toggleAttribute(SCROLLABLE_ATTR, scrollable);
36
+ if (scrollable) {
37
+ scrollableCount++;
38
+ if (!table.hasAttribute("tabindex")) {
39
+ table.tabIndex = 0;
40
+ table.dataset[TABINDEX_FLAG] = "true";
41
+ }
42
+ if (!table.hasAttribute("aria-label") && !table.hasAttribute("aria-labelledby")) {
43
+ table.setAttribute("aria-label", label);
44
+ table.dataset[LABEL_FLAG] = "true";
45
+ }
46
+ }
47
+ else {
48
+ if (table.dataset[TABINDEX_FLAG] === "true") {
49
+ table.removeAttribute("tabindex");
50
+ delete table.dataset[TABINDEX_FLAG];
51
+ }
52
+ if (table.dataset[LABEL_FLAG] === "true") {
53
+ table.removeAttribute("aria-label");
54
+ delete table.dataset[LABEL_FLAG];
55
+ }
56
+ }
57
+ }
58
+ return scrollableCount;
59
+ }
60
+ function ownerDocument(root) {
61
+ if (typeof Document !== "undefined" && root instanceof Document) {
62
+ return root;
63
+ }
64
+ return root.ownerDocument ?? globalThis.document;
65
+ }
66
+ //# sourceMappingURL=markdown-tables.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-tables.mjs","sourceRoot":"","sources":["../../../../home/runner/work/ox-content/ox-content/npm/vite-plugin-ox-content/src/markdown-tables.ts"],"names":[],"mappings":"AAaA,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAC9C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD,MAAM,UAAU,wBAAwB,CAAC,MAAe;IACtD,MAAM,QAAQ,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAiB,EACjB,OAAO,GAAoC,EAAE;IAE7C,MAAM,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IACtD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;IAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,eAAe,GAAG,CAAC,CAAC;IAExB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,IAAI,OAAO,W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AO,eAAe,CAAC;AACzB,CAAC;AAED,SAAS,aAAa,CAAC,IAAgB;IACrC,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,IAAI,YAAY,QAAQ,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,CAAC;AACnD,CAAC","sourcesContent":["export interface MarkdownTableEnhancementOptions {\n /**\n * Tables to enhance. Defaults to Markdown content tables styled by\n * `@ox-content/vite-plugin/styles/core.css`.\n */\n selector?: string;\n /**\n * Accessible name applied only when an overflowing table has no existing\n * `aria-label` or `aria-labelledby`.\n */\n label?: string;\n}\n\nconst TABINDEX_FLAG = \"oxTableScrollTabindex\";\nconst LABEL_FLAG = \"oxTableScrollLabel\";\nconst SCROLLABLE_ATTR = \"data-ox-table-scrollable\";\n\nexport function markdownTableScrollLabel(locale?: string): string {\n const language = locale?.split(\"-\")[0]?.toLowerCase();\n if (language === \"ja\") {\n return \"横スクロールできる表\";\n }\n return \"Scrollable table\";\n}\n\n/**\n * Makes overflowing Markdown tables keyboard-scrollable without wrapping or\n * replacing the native `<table>` element.\n *\n * Run this after rendering Markdown and again after layout-changing updates.\n * Narrow tables stay out of the tab order when overflow can be measured.\n */\nexport function enhanceMarkdownTables(\n root?: ParentNode,\n options: MarkdownTableEnhancementOptions = {},\n): number {\n const target = root ?? globalThis.document;\n if (!target?.querySelectorAll) {\n return 0;\n }\n\n const selector = options.selector ?? \".content table\";\n const locale = ownerDocument(target)?.documentElement.lang;\n const label = options.label ?? markdownTableScrollLabel(locale);\n let scrollableCount = 0;\n\n for (const table of target.querySelectorAll(selector)) {\n if (typeof HTMLElement === \"undefined\" || !(table instanceof HTMLElement)) {\n continue;\n }\n if (table.tagName !== \"TABLE\") {\n continue;\n }\n\n const scrollable = table.scrollWidth > table.clientWidth + 1;\n table.toggleAttribute(SCROLLABLE_ATTR, scrollable);\n if (scrollable) {\n scrollableCount++;\n if (!table.hasAttribute(\"tabindex\")) {\n table.tabIndex = 0;\n table.dataset[TABINDEX_FLAG] = \"true\";\n }\n if (!table.hasAttribute(\"aria-label\") && !table.hasAttribute(\"aria-labelledby\")) {\n table.setAttribute(\"aria-label\", label);\n table.dataset[LABEL_FLAG] = \"true\";\n }\n } else {\n if (table.dataset[TABINDEX_FLAG] === \"true\") {\n table.removeAttribute(\"tabindex\");\n delete table.dataset[TABINDEX_FLAG];\n }\n if (table.dataset[LABEL_FLAG] === \"true\") {\n table.removeAttribute(\"aria-label\");\n delete table.dataset[LABEL_FLAG];\n }\n }\n }\n\n return scrollableCount;\n}\n\nfunction ownerDocument(root: ParentNode): Document | undefined {\n if (typeof Document !== \"undefined\" && root instanceof Document) {\n return root;\n }\n return root.ownerDocument ?? globalThis.document;\n}\n"]}
@@ -4,6 +4,7 @@
4
4
  @import "./twitter-full.css";
5
5
  @import "./ogp.css";
6
6
  @import "./github.css";
7
+ @import "./markdown-tables.css";
7
8
  @import "./youtube.css";
8
9
  @import "./tabs.css";
9
10
  @import "./mermaid.css";
@@ -59,8 +59,8 @@
59
59
  --octc-focus-offset: 2px;
60
60
  --octc-motion-base: 150ms;
61
61
  --octc-motion-ease: ease;
62
- --octc-code-pad-block: 1rem;
63
- --octc-code-pad-inline: 1.25rem;
62
+ --octc-code-pad-block: 1.05rem;
63
+ --octc-code-pad-inline: 1rem;
64
64
  --octc-code-title-pad-block: 0.75rem;
65
65
  --octc-code-title-gap: 0.875rem;
66
66
  --octc-table-cell-pad-block: 0.75rem;
@@ -1013,11 +1013,11 @@ a:hover {
1013
1013
  margin-bottom: 0;
1014
1014
  }
1015
1015
  .content .ox-steps {
1016
- margin: 1.75rem 0 2rem;
1017
- padding: 1.1rem 1rem 1.1rem 0;
1016
+ margin: 1.25rem 0 1.5rem;
1017
+ padding: 0.85rem 0.9rem;
1018
1018
  border: 1px solid var(--octc-color-border);
1019
- border-radius: 8px;
1020
- background: color-mix(in srgb, var(--octc-color-bg-alt) 42%, transparent);
1019
+ border-radius: 6px;
1020
+ background: color-mix(in srgb, var(--octc-color-bg-alt) 34%, transparent);
1021
1021
  }
1022
1022
  .content .ox-steps__list {
1023
1023
  list-style: none;
@@ -1027,20 +1027,20 @@ a:hover {
1027
1027
  }
1028
1028
  .content .ox-steps__item {
1029
1029
  position: relative;
1030
- margin: 0 0 1rem;
1031
- padding-left: 2.5rem;
1030
+ margin: 0 0 0.85rem;
1031
+ padding-left: 2.2rem;
1032
1032
  counter-increment: ox-steps;
1033
1033
  }
1034
1034
  .content .ox-steps__item::before {
1035
1035
  content: counter(ox-steps);
1036
1036
  position: absolute;
1037
1037
  left: 0;
1038
- top: 0.15rem;
1038
+ top: 0.12rem;
1039
1039
  display: flex;
1040
1040
  align-items: center;
1041
1041
  justify-content: center;
1042
- width: 1.6rem;
1043
- height: 1.6rem;
1042
+ width: 1.45rem;
1043
+ height: 1.45rem;
1044
1044
  border-radius: 999px;
1045
1045
  background: var(--octc-color-primary);
1046
1046
  color: var(--octc-color-bg);
@@ -1196,13 +1196,13 @@ a:hover {
1196
1196
  position: relative;
1197
1197
  }
1198
1198
  .content pre.ox-code-block.line-numbers-mode .line {
1199
- padding-left: 4rem;
1199
+ padding-left: 3rem;
1200
1200
  }
1201
1201
  .content pre.ox-code-block.line-numbers-mode .line::before {
1202
1202
  content: attr(data-line-number);
1203
1203
  position: absolute;
1204
1204
  left: var(--octc-code-pad-inline);
1205
- width: 2rem;
1205
+ width: 1.65rem;
1206
1206
  text-align: right;
1207
1207
  color: var(--octc-color-code-line-number);
1208
1208
  user-select: none;
@@ -1264,7 +1264,7 @@ a:hover {
1264
1264
  margin: 1.25rem 0;
1265
1265
  font-size: 0.875rem;
1266
1266
  }
1267
- .content table[data-ox-table-scrollable="true"]:focus-visible {
1267
+ .content table[data-ox-table-scrollable]:focus-visible {
1268
1268
  outline: var(--octc-focus-ring);
1269
1269
  outline-offset: var(--octc-focus-offset);
1270
1270
  }
@@ -2104,10 +2104,10 @@ a:hover {
2104
2104
  font-size: 0.82rem !important;
2105
2105
  }
2106
2106
  .content pre.ox-code-block.line-numbers-mode .line {
2107
- padding-left: 3.7rem;
2107
+ padding-left: 2.85rem;
2108
2108
  }
2109
2109
  .content pre.ox-code-block.line-numbers-mode .line::before {
2110
- width: 1.75rem;
2110
+ width: 1.65rem;
2111
2111
  }
2112
2112
  .content table {
2113
2113
  margin: 1rem 0;
@@ -0,0 +1,16 @@
1
+ /* Responsive Markdown tables for custom hosts */
2
+ .content table {
3
+ display: block;
4
+ width: max-content;
5
+ max-width: 100%;
6
+ box-sizing: border-box;
7
+ overflow-x: auto;
8
+ -webkit-overflow-scrolling: touch;
9
+ }
10
+
11
+ /* `enhanceMarkdownTables()` marks overflow with `toggleAttribute()`, so the
12
+ attribute is present with an empty value. Match on presence, never a value. */
13
+ .content table[data-ox-table-scrollable]:focus-visible {
14
+ outline: var(--octc-focus-ring, 2px solid Highlight);
15
+ outline-offset: var(--octc-focus-offset, 2px);
16
+ }
@@ -17,6 +17,13 @@
17
17
  color: var(--octc-color-text);
18
18
  }
19
19
 
20
+ /* A fetched tweet renders `<figure><header>…` rather than wrapping its body in
21
+ one anchor, so the rule above never matches it. Pad the card itself to keep
22
+ it level with the Bluesky card. */
23
+ .ox-tweet--fetched {
24
+ padding: 1rem 0;
25
+ }
26
+
20
27
  .ox-tweet > a:hover,
21
28
  .ox-bluesky > a:hover {
22
29
  text-decoration: none;
@@ -292,13 +299,13 @@
292
299
  .ox-tweet__quote .ox-tweet__media {
293
300
  margin-bottom: 0;
294
301
  }
295
-
296
302
  /* WebContainer lazy placeholder */
297
303
  .ox-webcontainer {
298
304
  margin: 1.5rem 0;
299
305
  border: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
300
306
  border-radius: 8px;
301
307
  overflow: hidden;
308
+ background: var(--octc-color-bg);
302
309
  }
303
310
 
304
311
  .ox-webcontainer__header {
@@ -306,40 +313,79 @@
306
313
  align-items: center;
307
314
  justify-content: space-between;
308
315
  gap: 0.75rem;
309
- padding: 0.625rem 1rem;
316
+ padding: 0.65rem 0.85rem;
310
317
  border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
311
318
  background: var(--octc-color-bg-alt);
312
319
  }
313
320
 
314
- .ox-webcontainer__header strong {
321
+ .ox-webcontainer__title {
322
+ display: inline-flex;
323
+ align-items: center;
324
+ min-width: 0;
325
+ gap: 0.55rem;
326
+ }
327
+
328
+ .ox-webcontainer__title strong {
315
329
  font-size: 0.875rem;
316
330
  color: var(--octc-color-text);
317
331
  }
318
332
 
319
- .ox-webcontainer__header span {
333
+ .ox-webcontainer__title code {
334
+ color: var(--octc-color-text-muted);
335
+ overflow: hidden;
336
+ text-overflow: ellipsis;
337
+ white-space: nowrap;
338
+ }
339
+
340
+ .ox-webcontainer__status,
341
+ .ox-webcontainer__meta {
320
342
  font-size: 0.75rem;
321
343
  color: var(--octc-color-text-muted);
344
+ }
345
+
346
+ .ox-webcontainer__status {
347
+ padding: 0.16rem 0.5rem;
348
+ border: 1px solid color-mix(in srgb, var(--octc-color-primary) 26%, transparent);
349
+ border-radius: 999px;
350
+ background: color-mix(in srgb, var(--octc-color-primary) 8%, transparent);
351
+ color: var(--octc-color-primary);
322
352
  white-space: nowrap;
323
353
  }
324
354
 
355
+ .ox-webcontainer__preview {
356
+ background: var(--octc-color-code-bg);
357
+ }
358
+
325
359
  .ox-webcontainer pre {
326
360
  margin: 0;
327
361
  border: 0;
328
362
  border-radius: 0;
329
363
  }
364
+
365
+ .ox-webcontainer__meta {
366
+ display: flex;
367
+ flex-wrap: wrap;
368
+ gap: 0.45rem 0.85rem;
369
+ padding: 0.6rem 0.85rem;
370
+ border-top: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
371
+ background: color-mix(in srgb, var(--octc-color-bg-alt) 54%, transparent);
372
+ }
373
+
374
+ .ox-webcontainer__meta code {
375
+ color: var(--octc-color-text);
376
+ }
330
377
  /* Provider cards for static article, place, community, and social embeds */
331
378
  .ox-provider-card {
332
379
  display: block;
333
- margin: 1.5rem 0;
380
+ margin: 1rem 0;
334
381
  border: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
335
- border-radius: 8px;
382
+ border-radius: 6px;
336
383
  overflow: hidden;
337
384
  background: var(--octc-color-bg);
338
385
  }
339
386
 
340
387
  .ox-provider-card__main {
341
- display: block;
342
- padding: 1rem;
388
+ display: grid;
343
389
  color: var(--octc-color-text);
344
390
  text-decoration: none;
345
391
  }
@@ -358,7 +404,10 @@
358
404
  }
359
405
 
360
406
  .ox-provider-card__header {
361
- margin-bottom: 0.625rem;
407
+ min-height: 2.1rem;
408
+ padding: 0.45rem 0.8rem;
409
+ border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 68%, transparent);
410
+ background: color-mix(in srgb, var(--octc-color-bg-alt) 60%, transparent);
362
411
  font-size: 0.75rem;
363
412
  }
364
413
 
@@ -378,6 +427,7 @@
378
427
  align-items: flex-start;
379
428
  gap: 0.75rem;
380
429
  min-width: 0;
430
+ padding: 0.8rem;
381
431
  }
382
432
 
383
433
  .ox-provider-card__avatar {
@@ -393,7 +443,7 @@
393
443
  min-width: 0;
394
444
  }
395
445
 
396
- .ox-provider-card__title {
446
+ .ox-provider-card .ox-provider-card__title {
397
447
  margin: 0;
398
448
  font-size: 1rem;
399
449
  line-height: 1.35;
@@ -404,8 +454,8 @@
404
454
  text-decoration: underline;
405
455
  }
406
456
 
407
- .ox-provider-card__excerpt {
408
- margin: 0.625rem 0 0;
457
+ .ox-provider-card .ox-provider-card__excerpt {
458
+ margin: 0.35rem 0 0;
409
459
  font-size: 0.875rem;
410
460
  line-height: 1.55;
411
461
  color: var(--octc-color-text-muted);
@@ -417,15 +467,18 @@
417
467
  width: 100%;
418
468
  height: auto;
419
469
  max-height: 420px;
420
- margin-top: 0.875rem;
421
470
  border: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
422
- border-radius: 8px;
471
+ border-width: 1px 0 0;
472
+ border-radius: 0;
423
473
  object-fit: cover;
424
474
  background: var(--octc-color-bg-alt);
425
475
  }
426
476
 
427
477
  .ox-provider-card__meta {
428
- margin-top: 0.875rem;
478
+ min-height: 2.15rem;
479
+ padding: 0.45rem 0.8rem;
480
+ border-top: 1px solid color-mix(in srgb, var(--octc-color-border) 68%, transparent);
481
+ background: color-mix(in srgb, var(--octc-color-bg-alt) 48%, transparent);
429
482
  font-size: 0.75rem;
430
483
  }
431
484
 
@@ -1,18 +1,18 @@
1
1
  /* ox-content Tabs Plugin - Pure CSS, No JS */
2
2
 
3
3
  .ox-tabs {
4
- margin: 1.5rem 0;
4
+ margin: 1.25rem 0;
5
5
  border: 1px solid var(--octc-color-border);
6
- border-radius: 4px;
6
+ border-radius: 6px;
7
7
  overflow: hidden;
8
8
  background: var(--octc-color-bg);
9
9
  }
10
10
 
11
11
  .ox-tabs-header {
12
12
  display: flex;
13
- align-items: end;
14
- gap: 0.125rem;
15
- padding: 0.35rem 0.35rem 0;
13
+ align-items: center;
14
+ gap: 0.2rem;
15
+ padding: 0.35rem;
16
16
  background: var(--octc-color-bg-alt);
17
17
  border-bottom: 1px solid var(--octc-color-border);
18
18
  overflow-x: auto;
@@ -42,17 +42,17 @@
42
42
  display: inline-flex;
43
43
  align-items: center;
44
44
  justify-content: center;
45
- flex: 1 0 max-content;
46
- min-width: 3.5rem;
47
- padding: 0.65rem 0.85rem;
45
+ flex: 0 0 auto;
46
+ min-width: 0;
47
+ min-height: 2.1rem;
48
+ padding: 0.42rem 0.7rem;
48
49
  cursor: pointer;
49
- font-size: 0.875rem;
50
- font-weight: 500;
50
+ font-size: 0.8125rem;
51
+ font-weight: 600;
51
52
  color: var(--octc-color-text-muted);
52
53
  border: 1px solid transparent;
53
54
  border-bottom: 2px solid transparent;
54
- margin-bottom: -1px;
55
- border-radius: 4px 4px 0 0;
55
+ border-radius: 5px;
56
56
  white-space: nowrap;
57
57
  transition:
58
58
  background-color 0.2s ease,
@@ -82,7 +82,7 @@
82
82
  /* Tab content panels */
83
83
  .ox-tab-panel {
84
84
  display: none;
85
- padding: 1rem;
85
+ padding: 0.85rem 0.9rem;
86
86
  background: var(--octc-color-bg);
87
87
  }
88
88
 
@@ -169,7 +169,7 @@
169
169
  }
170
170
 
171
171
  .ox-tabs-fallback summary {
172
- padding: 0.75rem 1rem;
172
+ padding: 0.55rem 0.75rem;
173
173
  cursor: pointer;
174
174
  font-weight: 500;
175
175
  background: var(--octc-color-bg-alt);
@@ -198,7 +198,7 @@
198
198
  }
199
199
 
200
200
  .ox-tabs-fallback .ox-tabs-fallback-content {
201
- padding: 1rem;
201
+ padding: 0.85rem 0.9rem;
202
202
  }
203
203
 
204
204
  /* The disclosure marker still turns, it just turns instantly. */