Reputation: 315
I am in the process of integrating Netlify CMS to a Gatsby site. Right now, while editing or creating content, a preview of the content appears to the right of the screen in plain text. Is it possible to use the same styles for both the main page and the preview page so that they both look same?
I assume since the preview page gets rendered using the page template and the page template comes with its own styles, there would be no need for an extra stylesheet.
I've tried linking the stylesheets using CMS.registerPreviewStyle("link/to/my/css/file");
but nothing changes.
The developer console returns the error
Refused to apply style from 'https://my-site-name.com/admin/cms.css' because its MIME type ('text/html')" is not a supported stylesheet MIME type, and strict MIME checking is enabled."
However when I try to load the style sheet directly, I get a 404 error showing that it does not exist.
Upvotes: 2
Views: 1088
Reputation: 333
What you are doing is correct, just make sure that the path is right. For example, make sure that your CSS files are nested in the static
folder.
Upvotes: 1