You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is, this library rebuilds the code blocks' HTML entirely after Dark Reader inserts its inline style. We are working on stopping injecting inline styles. But in the meantime we will ignore the containers with [data-node-view-content] attribute.
The other question is, why dark theme is not being detected.
this library rebuilds the code blocks' HTML entirely after Dark Reader inserts its inline style.
ProseMirror uses MutationObserver (domobserver.ts#L53) to monitor the changes in contenteditable elements, update its inner state, and then trigger a re-rendering. That's probally why it rebuilds when Dark Reader inserts style.
But in the meantime we will ignore the containers with [data-node-view-content] attribute.
Thank you so much for your support! I just wanted to clarify a small detail in your commit. The [data-node-view-content] attribute isn't set by ProseMirror; it's actually set by a library called prosemirror-adapter at CoreNodeView.ts#L50.
I maintain both ProseKit and prosemirror-adapter, so I'm here to help if there's anything I can assist with. Perhaps providing a website link with source maps and without JavaScript minification would be helpful? Do you have any advice on how I can skip some updates on the ProseKit / prosemirror-adapter / ProseMirror side?
The other question is, why dark theme is not being detected.
I found the cause for not detecting the dark mode, it will be available in the next release, as well as the patch for the Mutation Observer.
Maybe if the observer won't react on style attribute changes, or won't rebuild the DOM and reused the existing nodes, it would work better. Dark Reader has its own observer for new nodes with inline styles, and the cycle repeats endlessly.
But anyway, we are working on avoiding DOM manipulations, and since the quick fix is working, there's no need to make any changes on your side.
Activity
alexanderby commentedon Nov 15, 2025
Nice example, thank you.
alexanderby commentedon Nov 18, 2025
I've lost access unfortunately: Internal server error.
ocavue commentedon Nov 18, 2025
Cloudflare is down: https://www.cloudflarestatus.com/incidents/8gmgl950y3h7
alexanderby commentedon Nov 18, 2025
The problem is, this library rebuilds the code blocks' HTML entirely after Dark Reader inserts its inline style. We are working on stopping injecting inline styles. But in the meantime we will ignore the containers with
[data-node-view-content]attribute.The other question is, why dark theme is not being detected.
ocavue commentedon Nov 18, 2025
ProseMirror uses
MutationObserver(domobserver.ts#L53) to monitor the changes in contenteditable elements, update its inner state, and then trigger a re-rendering. That's probally why it rebuilds when Dark Reader inserts style.Thank you so much for your support! I just wanted to clarify a small detail in your commit. The
[data-node-view-content]attribute isn't set by ProseMirror; it's actually set by a library called prosemirror-adapter atCoreNodeView.ts#L50.I maintain both ProseKit and prosemirror-adapter, so I'm here to help if there's anything I can assist with. Perhaps providing a website link with source maps and without JavaScript minification would be helpful? Do you have any advice on how I can skip some updates on the ProseKit / prosemirror-adapter / ProseMirror side?
I'm not quite sure what you mean. If you open https://prosekit.dev, you should be able to toggle between the dark and light themes by clicking the moon icon button in the top-right corner. This button will do the following things to the root
<html>element:data-theme="dark"/data-theme="light"darkclasscolor-scheme: dark;Should Dark Reader use the website's native dark theme (i.e., a
darkclass name) when possible?The dark theme toggle feature is powered by a small library written by me. You can see an online website for testing here: https://astro-theme-toggle.pages.dev/
Ignore ProseMirror code blocks
alexanderby commentedon Nov 19, 2025
I found the cause for not detecting the dark mode, it will be available in the next release, as well as the patch for the Mutation Observer.
Maybe if the observer won't react on style attribute changes, or won't rebuild the DOM and reused the existing nodes, it would work better. Dark Reader has its own observer for new nodes with inline styles, and the cycle repeats endlessly.
But anyway, we are working on avoiding DOM manipulations, and since the quick fix is working, there's no need to make any changes on your side.