Skip to content

Commit

Permalink
Merge pull request #464 from thepolicylab-projectportals/462-fix-cms-…
Browse files Browse the repository at this point in the history
…bug-cursor-jumps-to-end-of-editorcomponent-text-field

fix: overwrite default data-slate-editor styling
  • Loading branch information
hetd54 authored May 2, 2023
2 parents 0d54afb + e5df61d commit 5e6cbe9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[data-slate-editor] {
-webkit-user-modify: read-write !important;
}
16 changes: 16 additions & 0 deletions packages/project-portal-content-netlify/src/cms/cms-utils.js
Original file line number Diff line number Diff line change
@@ -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
)
}

}
3 changes: 3 additions & 0 deletions packages/project-portal-content-netlify/src/cms/cms.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit 5e6cbe9

Please sign in to comment.