TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.89k stars 381 forks source link

Isolate the style with a parent class #845

Closed wenerme closed 1 week ago

wenerme commented 2 weeks ago

Is your feature request related to a problem? Please describe.

import @blocknote/shadcn/style.css to project will cause unexpected sideeffect. this is what I have done:

gen:
    echo '.BlockNoteView { ' > ./styles.css
    curl -s 'https://cdn.jsdelivr.net/npm/@blocknote/react@0.14.1/dist/style.css' >> ./styles.css
    curl -s 'https://cdn.jsdelivr.net/npm/@blocknote/shadcn@0.14.1/dist/style.css' >> ./styles.css
    echo ' }' >> ./styles.css

Describe the solution you'd like

  1. add a parent class
  2. use css module
  3. or some css-in-js

Describe alternatives you've considered

Additional context

Bonus Not yet

matthewlipski commented 2 weeks ago

Hi, could you describe what side effects you're running into?

wenerme commented 2 weeks ago

Hi, could you describe what side effects you're running into?

Already using tw+daisyui+shadcn, when import the css, the page layout is changed, not looking for which rules affected, but the best I can do is add a scope for editor css.

matthewlipski commented 2 weeks ago

Ah gotcha, seems to be the same issue we're currently running into on the BlockNote docs website, should be fixed in #847 :)