mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem Apps repeat inline-code styles in classes and Markdown renderers, so code looks different across apps. See [DEPR-707](https://linear.app/supabase/issue/DEPR-707/apply-shared-default-styling-to-inline-code). ## Solution Add `packages/config/inline-code.css` for apps to import. It gives inline code a border and background, uses the default foreground colour, inherits the surrounding weight, and scales code from 12.5px beside 14px text to 14px beside 16px text, with a `0.75rem` minimum (normally 12px). Long values wrap only when needed. Code blocks, highlighted code and editors keep their own styles. `data-code-style="plain"` excludes other custom displays. Tailwind classes can override the defaults. No app imports the file yet, so this PR has no visual changes. Later PRs in the stack enable it per app, then #51986 removes the old styles. #51904 remains the full backup and should not merge alongside this stack. See that #51904 draft for what it looks like at the end. ## Review instructions Review the shared CSS in this one-file diff. App-specific changes and visual checks belong to the later PRs, up the stack.
58 lines
1.3 KiB
CSS
58 lines
1.3 KiB
CSS
/* 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;
|
|
}
|
|
}
|
|
}
|