Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(ui): add opt-in shared inline code defaults (#51980)

Danny Whitef3c8ea07e442
diff --git a/packages/config/inline-code.css b/packages/config/inline-code.css
new file mode 100644
index 00000000000..ee2a8d47ca9
--- /dev/null
+++ b/packages/config/inline-code.css
@@ -0,0 +1,57 @@
+/* Keep block renderers and displays with their own code styling independent. */
+@layer base {
+ code:not(
+ :where(
+ pre *,
+ [data-code-style='plain'],
+ [data-code-style='plain'] *,
+ [data-rehype-pretty-code-figure] *,
+ .ch-codeblock *,
+ .code-block *,
+ .code *,
+ .monaco-editor *,
+ .cm-editor *
+ )
+ ) {
+ @apply bg-surface-200 border border-muted rounded-sm px-1 py-0.25;
+
+ word-break: normal;
+ overflow-wrap: anywhere;
+ font-size: max(0.75rem, calc(0.75em + 2px), calc(1em - 2px));
+ line-height: inherit;
+ font-weight: inherit;
+ color: var(--foreground);
+ }
+}
+
+/* Match prose typography while keeping local utility overrides effective. */
+@utility prose {
+ :where(code):not(
+ :where(
+ pre *,
+ [data-code-style='plain'],
+ [data-code-style='plain'] *,
+ [data-rehype-pretty-code-figure] *,
+ .ch-codeblock *,
+ .code-block *,
+ .code *,
+ .monaco-editor *,
+ .cm-editor *,
+ .not-prose *
+ )
+ ) {
+ @apply bg-surface-200 border border-muted rounded-sm px-1 py-0.25;
+
+ word-break: normal;
+ overflow-wrap: anywhere;
+ font-size: max(0.75rem, calc(0.75em + 2px), calc(1em - 2px));
+ line-height: inherit;
+ font-weight: inherit;
+ color: var(--foreground);
+
+ &::before,
+ &::after {
+ content: none;
+ }
+ }
+}