Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropcaps #128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Dropcaps #128

wants to merge 3 commits into from

Conversation

Murkyside
Copy link

Dropcaps formatting added to article page.

added style tag into article body.
@Murkyside Murkyside requested a review from joe2k01 December 15, 2023 14:50
changed padding to fit into articles better
@@ -202,7 +202,7 @@ const imagePlaceHolder =
<div
id="article-content"
class="whitespace-pre-wrap text-justify"
set:html={articleDraft.articlesDrafts_text}
set:html={articleDraft.articlesDrafts_text + "<style scoped>div > p:first-child:first-letter {float: left;font-size: 90px;line-height: 60px;padding-top: 4px;padding-right: 8px;padding-left: 3px;}</style>"}
Copy link
Contributor

@joe2k01 joe2k01 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't concatenate the raw article html with a style tag. It'd be more elegant to follow the Astro style pattern. You can add the style element as you would in a static HTML page. See the Astro docs and this example (position on template does not matter).

However, the element should be conditionally rendered depending on whether the article being rendered wants dropcaps or not. I.e. :

{
    article.articles_dropCapital && (
        <style>
        ...
        </style>
    )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants