diff --git a/packages/project-portal-content-netlify/src/cms/admin/admin.css b/packages/project-portal-content-netlify/src/cms/admin/admin.css new file mode 100644 index 000000000..f1be6712b --- /dev/null +++ b/packages/project-portal-content-netlify/src/cms/admin/admin.css @@ -0,0 +1,3 @@ +[data-slate-editor] { + -webkit-user-modify: read-write !important; +} diff --git a/packages/project-portal-content-netlify/src/cms/cms-utils.js b/packages/project-portal-content-netlify/src/cms/cms-utils.js new file mode 100644 index 000000000..e5ea97104 --- /dev/null +++ b/packages/project-portal-content-netlify/src/cms/cms-utils.js @@ -0,0 +1,16 @@ +if (typeof window !== 'undefined') { + + // add admin.css + const link = document.createElement('link') + link.type = 'text/css' + link.rel = 'stylesheet' + link.href = '/admin/admin.css' + document.head.appendChild(link) + + if (process.env.NETLIFY_SITE_URL) { + window.localStorage.setItem( + 'netlifySiteURL', process.env.NETLIFY_SITE_URL + ) + } + +} diff --git a/packages/project-portal-content-netlify/src/cms/cms.js b/packages/project-portal-content-netlify/src/cms/cms.js index 15ee73db1..b9e150208 100644 --- a/packages/project-portal-content-netlify/src/cms/cms.js +++ b/packages/project-portal-content-netlify/src/cms/cms.js @@ -1,5 +1,8 @@ import CMS from "netlify-cms-app" +// Add custom styles to the index.html page +import "./cms-utils" + // The following configuration is merged with the configuration from the site's config.yml file // (if it exists in the site's directory static/admin/config.yml) CMS.init({