Skip to content

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
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
Member

@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.

3 participants