0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Added sequential load for CSS

- Loading CSS from external source might take time which can result in
content appearing for a split-second without any formatting. To avoid
this, we added a CSS class that hides all content until the CSS is
properly loaded.
This commit is contained in:
Peter Zimon 2022-07-08 13:26:23 +02:00
parent 6cb29e434a
commit 08cc74c894
3 changed files with 16 additions and 2 deletions

View file

@ -50,7 +50,7 @@ const CommentsBox = (props) => {
};
return (
<section className={containerClass} style={style}>
<section className={'ghost-display' + containerClass} style={style}>
<Pagination />
<div className={!pagination ? 'mt-4' : ''}>
{commentsElements}

View file

@ -7,8 +7,18 @@ const ShadowRoot = ({
...props
}) => {
const cssLink = getBundledCssLink({appVersion: props.appVersion});
const styles = `
.ghost-display {
display: none;
}
`;
const head = (
<link rel="stylesheet" href={cssLink} />
<>
<link rel="stylesheet" href={cssLink} />
<style dangerouslySetInnerHTML={{__html: styles}} />
</>
);
return (

View file

@ -53,4 +53,8 @@ body {
[contenteditable]:focus {
outline: 0px solid transparent;
}
.ghost-display {
display: block !important;
}