diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 65de45177..75a07c7d1 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -23,7 +23,6 @@ import safeHTML from './safeHTML.js'; const PAGEBREAK_REGEX_V3 = /^(?=\\page(?:break)?(?: *{[^\n{}]*})?$)/m; const PAGEBREAK_REGEX_LEGACY = /\\page(?:break)?/m; const COLUMNBREAK_REGEX_LEGACY = /\\column(:?break)?/m; -const PAGE_HEIGHT = 1056; const TOOLBAR_STATE_KEY = 'HB_renderer_toolbarState'; @@ -47,31 +46,25 @@ const BrewPage = (props)=>{ }; const pageRef = useRef(null); const cleanText = safeHTML(props.contents); + const pageNum = props.index + 1; useEffect(()=>{ if(!pageRef.current) return; - // Observer for tracking pages within the `.pages` div + // Observer for tracking which pages are at least 30% visible in the iframe const visibleObserver = new IntersectionObserver( - (entries)=>{ - entries.forEach((entry)=>{ - if(entry.isIntersecting) - props.onVisibilityChange(props.index + 1, true, false); // add page to array of visible pages. - else - props.onVisibilityChange(props.index + 1, false, false); - }); - }, + (entries)=>entries.forEach((entry)=>{ + props.onVisibilityChange(pageNum, entry.isIntersecting, false); // add page to array of visible pages. + }), { threshold: .3, rootMargin: '0px 0px 0px 0px' } // detect when >30% of page is within bounds. ); // Observer for tracking the page at the center of the iframe. const centerObserver = new IntersectionObserver( - (entries)=>{ - entries.forEach((entry)=>{ - if(entry.isIntersecting) - props.onVisibilityChange(props.index + 1, true, true); // Set this page as the center page - }); - }, + (entries)=>entries.forEach((entry)=>{ + if(entry.isIntersecting) + props.onVisibilityChange(pageNum, true, true); // Set this page as the center page + }), { threshold: 0, rootMargin: '-50% 0px -50% 0px' } // Detect when the page is at the center ); @@ -92,7 +85,7 @@ const BrewPage = (props)=>{ //v=====--------------------< Brew Renderer Component >-------------------=====v// let renderedPages = []; -let pageTemplates = []; +const pageTemplates = []; let rawPages = []; const BrewRenderer = (props)=>{ @@ -100,22 +93,21 @@ const BrewRenderer = (props)=>{ text : '', style : '', renderer : 'legacy', - theme : '5ePHB', lang : '', errors : [], currentEditorCursorPageNum : 1, - currentEditorViewPageNum : 1, currentBrewRendererPageNum : 1, themeBundle : {}, onPageChange : ()=>{}, ...props }; + const [visiblePages, setVisiblePages] = useState([]); + const [centerPage , setCenterPage ] = useState(1); + const [state, setState] = useState({ - isMounted : false, - visibility : 'hidden', - visiblePages : [], - centerPage : 1 + isMounted : false, + visibility : 'hidden' }); const [displayOptions, setDisplayOptions] = useState({ @@ -135,9 +127,7 @@ const BrewRenderer = (props)=>{ const [headerState, setHeaderState] = useState(false); - const mainRef = useRef(null); const pagesRef = useRef(null); - const urlRef = useRef(''); if(props.renderer == 'legacy') { rawPages = props.text.split(PAGEBREAK_REGEX_LEGACY); @@ -146,20 +136,16 @@ const BrewRenderer = (props)=>{ } const handlePageVisibilityChange = (pageNum, isVisible, isCenter)=>{ - setState((prevState)=>{ - const updatedVisiblePages = new Set(prevState.visiblePages); - if(!isCenter) - isVisible ? updatedVisiblePages.add(pageNum) : updatedVisiblePages.delete(pageNum); - - return { - ...prevState, - visiblePages : [...updatedVisiblePages].sort((a, b)=>a - b), - centerPage : isCenter ? pageNum : prevState.centerPage - }; + setVisiblePages((prev)=>{ + const updatedVisiblePages = new Set(prev); + isVisible ? updatedVisiblePages.add(pageNum) : updatedVisiblePages.delete(pageNum); + return [...updatedVisiblePages].sort((a, b)=>a - b); }); - if(isCenter) + if(isCenter) { + setCenterPage(pageNum); props.onPageChange(pageNum); + } }; const isInView = (index)=>{ @@ -341,19 +327,19 @@ const BrewRenderer = (props)=>{ : null} -
+
- 0 ? state.visiblePages : [state.centerPage]} totalPages={rawPages.length} headerState={headerState} setHeaderState={setHeaderState}/> + 0 ? visiblePages : [centerPage]} totalPages={rawPages.length} headerState={headerState} setHeaderState={setHeaderState}/> {/*render in iFrame so broken code doesn't crash the site.*/} - {emitClick();}} - sandbox="allow-same-origin allow-modals allow-top-navigation" + sandbox='allow-same-origin allow-modals allow-top-navigation' >
{ + const version = global.version || '0.0.0'; - render : function(){ - return + return ( +
The Homebrewery
- {`v${this.state.ver}`} + {`v${version}`} - {/*this.renderChromeWarning()*/} + {/* this.renderChromeWarning() */}
- {this.props.children} -
; - } -}); + {children} +
+ ); +}; -export default Navbar; +export default Navbar; \ No newline at end of file diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index a0287236b..57667ca6e 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js'; -import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.js' +import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx' import SplitPane from '@components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; @@ -53,8 +53,6 @@ const EditPage = (props)=>{ }; const [currentBrew, setCurrentBrew] = useState(props.brew); - const [isSaving, setIsSaving] = useState(false); - const [lastSavedTime, setLastSavedTime] = useState(new Date()); const [saveGoogle, setSaveGoogle] = useState(!!props.brew.googleId); const [error, setError] = useState(null); const [HTMLErrors, setHTMLErrors] = useState(hbfm.validate(props.brew.text)); @@ -62,13 +60,10 @@ const EditPage = (props)=>{ const [currentEditorCursorPageNum, setCurrentEditorCursorPageNum] = useState(1); const [currentBrewRendererPageNum, setCurrentBrewRendererPageNum] = useState(1); const [themeBundle, setThemeBundle] = useState({}); - const [unsavedChanges, setUnsavedChanges] = useState(false); const [alertTrashedGoogleBrew, setAlertTrashedGoogleBrew] = useState(props.brew.trashed); const [alertNoGoogleToTransfer, setAlertNoGoogleToTransfer] = useState(false); const [alertOwnershipToTransfer, setAlertOwnershipToTransfer] = useState(false); const [confirmGoogleTransfer, setConfirmGoogleTransfer] = useState(false); - const [autoSaveEnabled, setAutoSaveEnabled] = useState(true); - const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true); const editorRef = useRef(null); const lastSavedBrew = useRef(_.cloneDeep(props.brew)); @@ -206,52 +201,12 @@ const EditPage = (props)=>{ ); - const renderSaveButton = ()=>{ - // #1 - Currently saving, show SAVING - if(isSaving) - return saving...; - - // #2 - Unsaved changes exist, autosave is OFF and warning timer has expired, show AUTOSAVE WARNING - if(unsavedChanges && warnUnsavedChanges) { - resetWarnUnsavedTimer(); - const elapsedTime = Math.round((new Date() - lastSavedTime) / 1000 / 60); - const text = elapsedTime === 0 - ? `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}.` - : `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}, and you haven't saved for ${elapsedTime} minutes.`; - - return - Reminder... -
{text}
-
; - } - - // #3 - Unsaved changes exist, click to save, show SAVE NOW - if(unsavedChanges) - return trySave(true, true, saveGoogle)} color='blue' icon='fas fa-save'>save now; - - // #4 - No unsaved changes, autosave is ON, show AUTO-SAVED - if(autoSaveEnabled) - return auto-saved; - - // #5 - Sandbox with no unsaved changes, and has never been saved, hide the button - if(sandbox) - return save now; - - // DEFAULT - No unsaved changes, show SAVED - return saved; - }; - const renderAutoSaveButton = ()=>( Autosave ); - const clearError = ()=>{ - setError(null); - setIsSaving(false); - }; - const renderNavbar = ()=>{ return @@ -278,10 +233,12 @@ const EditPage = (props)=>{ }; const { - resetWarnUnsavedTimer, handleSplitMove, handleBrewChange, toggleAutoSave, + clearError, + renderSaveButton, + autoSaveEnabled, trySave } = useCommonEditPageFunctions({ saveGoogle, @@ -297,19 +254,10 @@ const EditPage = (props)=>{ SNIPKEY, METAKEY, hbfm, - autoSaveEnabled, - setAutoSaveEnabled, - setWarnUnsavedChanges, - unsavedChanges, - setUnsavedChanges, sandbox, lastSavedBrew, editorRef, - isSaving, - setIsSaving, save, - lastSavedTime, - setLastSavedTime }); return ( @@ -341,12 +289,10 @@ const EditPage = (props)=>{ text={currentBrew.text} style={currentBrew.style} renderer={currentBrew.renderer} - theme={currentBrew.theme} themeBundle={themeBundle} errors={HTMLErrors} lang={currentBrew.lang} onPageChange={setCurrentBrewRendererPageNum} - currentEditorViewPageNum={currentEditorViewPageNum} currentEditorCursorPageNum={currentEditorCursorPageNum} currentBrewRendererPageNum={currentBrewRendererPageNum} allowPrint={true} diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index a1a4a257e..0ac78f0e1 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; -import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.js' +import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx' import SplitPane from '@components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; @@ -53,11 +53,6 @@ const HomePage =(props)=>{ const [currentEditorCursorPageNum, setCurrentEditorCursorPageNum] = useState(1); const [currentBrewRendererPageNum, setCurrentBrewRendererPageNum] = useState(1); const [themeBundle, setThemeBundle] = useState({}); - const [unsavedChanges, setUnsavedChanges] = useState(false); - const [isSaving, setIsSaving] = useState(false); - const [lastSavedTime, setLastSavedTime] = useState(new Date()); - const [autoSaveEnabled, setAutoSaveEnabled] = useState(false); - const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true); const editorRef = useRef(null); const lastSavedBrew = useRef(_.cloneDeep(props.brew)); @@ -77,46 +72,6 @@ const HomePage =(props)=>{ window.location = `/edit/${saved.editId}`; }; - const renderSaveButton = ()=>{ - // #1 - Currently saving, show SAVING - if(isSaving) - return saving...; - - // #2 - Unsaved changes exist, autosave is OFF and warning timer has expired, show AUTOSAVE WARNING - if(unsavedChanges && warnUnsavedChanges) { - resetWarnUnsavedTimer(); - const elapsedTime = Math.round((new Date() - lastSavedTime) / 1000 / 60); - const text = elapsedTime === 0 - ? `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}.` - : `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}, and you haven't saved for ${elapsedTime} minutes.`; - - return - Reminder... -
{text}
-
; - } - - // #3 - Unsaved changes exist, click to save, show SAVE NOW - if(unsavedChanges) - return trySave(true, true, saveGoogle)} color='blue' icon='fas fa-save'>save now; - - // #4 - No unsaved changes, autosave is ON, show AUTO-SAVED - if(autoSaveEnabled) - return auto-saved; - - // #5 - Sandbox with no unsaved changes, and has never been saved, hide the button - if(sandbox) - return save now; - - // DEFAULT - No unsaved changes, show SAVED - return saved; - }; - - const clearError = ()=>{ - setError(null); - setIsSaving(false); - }; - const renderNavbar = ()=>{ return @@ -134,9 +89,11 @@ const HomePage =(props)=>{ }; const { - resetWarnUnsavedTimer, handleSplitMove, handleBrewChange, + clearError, + renderSaveButton, + unsavedChanges, trySave } = useCommonEditPageFunctions({ saveGoogle, @@ -152,19 +109,10 @@ const HomePage =(props)=>{ SNIPKEY, METAKEY, hbfm, - autoSaveEnabled, - setAutoSaveEnabled, - setWarnUnsavedChanges, - unsavedChanges, - setUnsavedChanges, sandbox, lastSavedBrew, editorRef, - isSaving, - setIsSaving, save, - lastSavedTime, - setLastSavedTime }); return ( @@ -190,11 +138,10 @@ const HomePage =(props)=>{ text={currentBrew.text} style={currentBrew.style} renderer={currentBrew.renderer} + themeBundle={themeBundle} onPageChange={setCurrentBrewRendererPageNum} - currentEditorViewPageNum={currentEditorViewPageNum} currentEditorCursorPageNum={currentEditorCursorPageNum} currentBrewRendererPageNum={currentBrewRendererPageNum} - themeBundle={themeBundle} />
diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index 1ec1720f4..c7b6c7160 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -10,7 +10,7 @@ import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js'; -import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.js' +import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx' import SplitPane from '@components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; @@ -45,8 +45,6 @@ const NewPage = (props)=>{ }; const [currentBrew, setCurrentBrew] = useState(props.brew); - const [isSaving, setIsSaving] = useState(false); - const [lastSavedTime, setLastSavedTime] = useState(new Date()); const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false); const [error, setError] = useState(null); const [HTMLErrors, setHTMLErrors] = useState(hbfm.validate(props.brew.text)); @@ -54,9 +52,6 @@ const NewPage = (props)=>{ const [currentEditorCursorPageNum, setCurrentEditorCursorPageNum] = useState(1); const [currentBrewRendererPageNum, setCurrentBrewRendererPageNum] = useState(1); const [themeBundle, setThemeBundle] = useState({}); - const [unsavedChanges, setUnsavedChanges] = useState(false); - const [autoSaveEnabled, setAutoSaveEnabled] = useState(false); - const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true); const editorRef = useRef(null); const lastSavedBrew = useRef(_.cloneDeep(props.brew)); @@ -121,46 +116,6 @@ const NewPage = (props)=>{ window.location = `/edit/${savedBrew.editId}`; }; - const renderSaveButton = ()=>{ - // #1 - Currently saving, show SAVING - if(isSaving) - return saving...; - - // #2 - Unsaved changes exist, autosave is OFF and warning timer has expired, show AUTOSAVE WARNING - if(unsavedChanges && warnUnsavedChanges) { - resetWarnUnsavedTimer(); - const elapsedTime = Math.round((new Date() - lastSavedTime) / 1000 / 60); - const text = elapsedTime === 0 - ? `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}.` - : `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}, and you haven't saved for ${elapsedTime} minutes.`; - - return - Reminder... -
{text}
-
; - } - - // #3 - Unsaved changes exist, click to save, show SAVE NOW - if(unsavedChanges) - return trySave(true, true, saveGoogle)} color='blue' icon='fas fa-save'>save now; - - // #4 - No unsaved changes, autosave is ON, show AUTO-SAVED - if(autoSaveEnabled) - return auto-saved; - - // #5 - Sandbox with no unsaved changes, and has never been saved, hide the button - if(sandbox) - return save now; - - // DEFAULT - No unsaved changes, show SAVED - return saved; - }; - - const clearError = ()=>{ - setError(null); - setIsSaving(false); - }; - const renderNavbar = ()=>( @@ -182,10 +137,10 @@ const NewPage = (props)=>{ ); const { - resetWarnUnsavedTimer, handleSplitMove, handleBrewChange, - trySave + clearError, + renderSaveButton } = useCommonEditPageFunctions({ saveGoogle, setError, @@ -200,19 +155,10 @@ const NewPage = (props)=>{ SNIPKEY, METAKEY, hbfm, - autoSaveEnabled, - setAutoSaveEnabled, - setWarnUnsavedChanges, - unsavedChanges, - setUnsavedChanges, sandbox, lastSavedBrew, editorRef, - isSaving, - setIsSaving, save, - lastSavedTime, - setLastSavedTime }); return ( @@ -237,12 +183,10 @@ const NewPage = (props)=>{ text={currentBrew.text} style={currentBrew.style} renderer={currentBrew.renderer} - theme={currentBrew.theme} themeBundle={themeBundle} errors={HTMLErrors} lang={currentBrew.lang} onPageChange={setCurrentBrewRendererPageNum} - currentEditorViewPageNum={currentEditorViewPageNum} currentEditorCursorPageNum={currentEditorCursorPageNum} currentBrewRendererPageNum={currentBrewRendererPageNum} allowPrint={true} diff --git a/client/homebrew/utils/commonEditPageFunctions.js b/client/homebrew/utils/commonEditPageFunctions.jsx similarity index 74% rename from client/homebrew/utils/commonEditPageFunctions.js rename to client/homebrew/utils/commonEditPageFunctions.jsx index e49e29136..c8ecbaa0c 100644 --- a/client/homebrew/utils/commonEditPageFunctions.js +++ b/client/homebrew/utils/commonEditPageFunctions.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect, useEffectEvent, useRef } from 'react'; import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js'; import _ from 'lodash'; +import Nav from '@navbar/nav.jsx'; const AUTOSAVE_KEY = 'HB_editor_autoSaveOn'; @@ -23,21 +24,18 @@ export default function useCommonEditPageFunctions(dependencies) { SNIPKEY, METAKEY, hbfm, - autoSaveEnabled, - setAutoSaveEnabled, - setWarnUnsavedChanges, sandbox, - unsavedChanges, - setUnsavedChanges, lastSavedBrew, editorRef, - isSaving, - setIsSaving, save, - lastSavedTime, - setLastSavedTime } = dependencies; + const [isSaving , setIsSaving] = useState(false); + const [lastSavedTime , setLastSavedTime] = useState(new Date()); + const [autoSaveEnabled , setAutoSaveEnabled] = useState(!sandbox); + const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true); + const [unsavedChanges , setUnsavedChanges] = useState(false); + const unsavedChangesRef = useRef(unsavedChanges); // onBeforeUnload lives outside React and needs ref to unsavedChanges const warnUnsavedTimeout = useRef(null); // timers live outside React and need ref to consistently track time const saveTimeout = useRef(null); @@ -59,7 +57,6 @@ export default function useCommonEditPageFunctions(dependencies) { e.preventDefault(); } }; - document.addEventListener('keydown', handleControlKeys); window.onbeforeunload = ()=>{ if(unsavedChangesRef.current) @@ -121,6 +118,11 @@ export default function useCommonEditPageFunctions(dependencies) { setWarnUnsavedChanges(autoSaveEnabled); }; + const clearError = ()=>{ + setError(null); + setIsSaving(false); + }; + const trySave = useEffectEvent((forceSave = false, hasChanges = true, saveToGoogle = false)=>{ clearTimeout(saveTimeout.current); if(isSaving) return; @@ -140,11 +142,43 @@ export default function useCommonEditPageFunctions(dependencies) { }, newTimeout); }); + const renderSaveButton = ()=>{ + if(isSaving) + return saving...; + + if(unsavedChanges && warnUnsavedChanges) { + resetWarnUnsavedTimer(); + const elapsedTime = Math.round((new Date() - lastSavedTime) / 1000 / 60); + const text = elapsedTime === 0 + ? `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}.` + : `Autosave is OFF${sandbox ? ' for this sandbox page' : ''}, and you haven't saved for ${elapsedTime} minutes.`; + + return + Reminder... +
{text}
+
; + } + + if(unsavedChanges) + return trySave(true, true, saveGoogle)} color='blue' icon='fas fa-save'>save now; + + if(autoSaveEnabled) + return auto-saved; + + if(sandbox) + return save now; + + return saved; + }; + return { - resetWarnUnsavedTimer, handleSplitMove, handleBrewChange, toggleAutoSave, + clearError, trySave, + renderSaveButton, + autoSaveEnabled, + unsavedChanges, } } \ No newline at end of file diff --git a/themes/V3/5eDMG/style.less b/themes/V3/5eDMG/style.less index d79533c2c..8aad90315 100644 --- a/themes/V3/5eDMG/style.less +++ b/themes/V3/5eDMG/style.less @@ -14,6 +14,7 @@ .note table tbody tr:nth-child(odd) { background : #FFFFFF; } /* DROP CAP */ + .first-letter, .drop-cap h1 + p::first-letter { color : black; background-image : unset; diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index fee12e1f6..73ac5cb43 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -30,6 +30,7 @@ export default [ name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', gen : dedent`/* Drop Cap settings */ + .page .first-letter, .page .drop-cap, .page h1 + p::first-letter { font-family: SolberaImitationRemake; font-size: 3.5cm; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 12601bb5d..28bde8a2f 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -85,23 +85,24 @@ line-height : 1em; -webkit-column-span : all; -moz-column-span : all; - & + p::first-letter { - float : left; - padding-bottom : 2px; - padding-left : 40px; //Allow background color to extend into margins - margin-top : -0.3cm; - margin-bottom : -20px; - margin-left : -40px; - font-family : 'SolberaImitationRemake'; - font-size : 3.5cm; - line-height : 1em; - color : rgba(0, 0, 0, 0); - background-image : linear-gradient(-45deg, #322814, #998250, #322814); - -webkit-background-clip : text; - background-clip : text; - } & + p::first-line { font-variant : small-caps; } } + .first-letter, .drop-cap, + h1 + p::first-letter { + float : left; + padding-bottom : 2px; + padding-left : 40px; //Allow background color to extend into margins + margin-top : -0.3cm; + margin-bottom : -20px; + margin-left : -40px; + font-family : 'SolberaImitationRemake'; + font-size : 3.5cm; + line-height : 1em; + color : rgba(0, 0, 0, 0); + background-image : linear-gradient(-45deg, #322814, #998250, #322814); + -webkit-background-clip : text; + background-clip : text; + } h2 { //margin-top : 0px; //Font is misaligned. Shift up slightly //margin-bottom : 0.05cm; @@ -196,7 +197,7 @@ } & + * { margin-top : 0.54cm; } - + } // ***************************** @@ -279,7 +280,7 @@ .watermark { color : black; } /* Watercolor */ - + .watercolor1 { --wc : @watercolor1; } .watercolor2 { --wc : @watercolor2; } .watercolor3 { --wc : @watercolor3; } diff --git a/themes/V3/Journal/style.less b/themes/V3/Journal/style.less index 74c976f47..9b9b7d024 100644 --- a/themes/V3/Journal/style.less +++ b/themes/V3/Journal/style.less @@ -80,21 +80,22 @@ font-size : 0.89cm; font-variant : small-caps; line-height : 1em; - & + p::first-letter { - float : left; - padding-top : 0.3em; - padding-bottom : 2px; - padding-left : 40px; //Allow background color to extend into margins - margin-top : -0.3cm; - margin-right : 0.1em; - margin-bottom : -20px; - margin-left : -40px; - font-family : 'FrederickaTheGreat'; - font-size : 1.9em; - line-height : 1em; - } & + p::first-line { font-variant : small-caps; } } + .first-letter, .drop-cap, + h1 + p::first-letter { + float : left; + padding-top : 0.3em; + padding-bottom : 2px; + padding-left : 40px; //Allow background color to extend into margins + margin-top : -0.3cm; + margin-right : 0.1em; + margin-bottom : -20px; + margin-left : -40px; + font-family : 'FrederickaTheGreat'; + font-size : 1.9em; + line-height : 1em; + } h2 { font-size : 0.62cm; line-height : 0.988em; //Font is misaligned. Shift up slightly