Closed softmarshmallow closed 4 months ago
Issue remains, I've swtiched to @blocknote/mantine
(really wish to use shadcn though)
For who still want to match there styles with shadcn, here's a custom style you can override for @blocknote/mantine
to match shadcn styles.
/*
- https://www.blocknotejs.org/docs/styling-theming/themes
*/
/* Base theme */
.bn-container[data-theming-ui-css-variables][data-color-scheme] {
--bn-colors-editor-text: hsl(var(--foreground));
--bn-colors-editor-background: hsl(var(--background));
--bn-colors-menu-text: hsl(var(--popover-foreground));
--bn-colors-menu-background: hsl(var(--popover));
--bn-colors-tooltip-text: hsl(var(--foreground));
--bn-colors-tooltip-background: hsl(var(--background));
--bn-colors-hovered-text: hsl(var(--accent-foreground));
--bn-colors-hovered-background: hsl(var(--accent));
--bn-colors-selected-text: hsl(var(--foreground));
--bn-colors-selected-background: hsl(var(--accent));
--bn-colors-disabled-text: hsl(var(--muted-foreground));
--bn-colors-disabled-background: hsl(var(--muted));
--bn-colors-shadow: rgba(0, 0, 0, 0.04);
--bn-colors-border: hsl(var(--border));
--bn-colors-side-menu: hsl(var(--muted-foreground));
--bn-border-radius: var(--radius);
}
import { BlockNoteView } from "@blocknote/mantine";
import "@blocknote/mantine/style.css";
import "./styles.css";
<BlockNoteView
data-theming-ui-css-variables
{...props}
className={cn(
"min-h-[120px] h-full w-full bg-transparent placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
props.className
)}
/>
Importing shadcn/styles.css will break the existing shadcn styles, -
border
https://github.com/TypeCellOS/BlockNote/assets/16307013/9a2fb7ce-68a5-4884-b385-96d13964ccb0
(A different topic, but also the
@blocknote/shadcn/style.css
does not respect the customized shadcn colors (in my case I am using neutral)My globals.css