@mocanvas/compat · function

assertCompatStylesLoaded

declare function assertCompatStylesLoaded(): boolean

Warn when compat.css is missing, for an app that is migrating.

The tldraw-compat rules are calc() over --tl-* variables that this package's stylesheet declares. Without it they resolve to nothing and the calc()s collapse: type that should scale with the camera comes out at a constant, tiny size. Nothing throws, so it reads as a rendering bug in the library rather than a missing import — which is exactly how it was found.

Opt-in rather than automatic, and not in <Mocanvas>: most consumers never load compat.css and should not be told to. Call this from a migrating app's dev entry point. Returns whether the stylesheet was found, so a test can assert on it; warns only in development.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.