Skip to content

Commit

Permalink
Insert quillStyles via js
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-leamon committed Dec 17, 2023
1 parent 2a00bb6 commit a1f1379
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/RichTextEditor/RichTextEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect, FC, useMemo, useRef } from 'react'
import styled from 'styled-components'
import './quill.css'
import { StyleHTML } from '../../internal'
import { StyleHTML, insertCSS } from '../../internal'
import { quillStyles } from './quillStyles'

interface RichTextEditorProps {
value: string
Expand All @@ -18,6 +18,7 @@ export const RichTextEditor: FC<RichTextEditorProps> = ({
const quillRef = useRef(null)

useEffect(() => {
insertCSS(quillStyles)
import('react-quill').then(() => {
setLoaded(true)
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const quillStyles = `
.quill {
position: relative;
}
Expand Down Expand Up @@ -546,4 +547,5 @@
z-index: 1000; /* To ensure it stays above other content */
background: var(--F_Background);
border-bottom: 1px solid var(--F_Surface);
}
}
`

0 comments on commit a1f1379

Please sign in to comment.