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

Remove redundant CSS formatting on <ol> elements #35

Closed
wants to merge 1 commit into from

Conversation

apiraino
Copy link
Contributor

With this patch I'm trying to fix some CSS that is applied to the <ol> HTML element.

Rendering before this patch
screenshot-20221010-122905

The HTML rendered by Zola is correct:
<ol>
<li>First item</li>
<li>Second item (leading spaces ignored)</li>
</ol>
<p>I want to start the following list from an arbitrary number:</p>
<ol start="3">
<li>I want this to be the third item</li>
<li>I want this to be the fourth item</li>
</ol>

But I see two small CSS issues:

  • there is no padding between the <li> and the text
  • the start parameter of the <ol> element is overriden by the CSS

Rendering after this patch
screenshot-20221010-122739

Note: I'm not a CSS wizard so I'm not entirely sure these changes have unintended side-effects. Namely I'd be curious to test them against the markdown from #24 but I could not find the repo of the issue reporter (they have also changed Zola theme in the meanwhile...)

@Keats opinions? thanks :)

@Keats
Copy link
Collaborator

Keats commented Oct 10, 2022

The no {margin,padding} is part of the aesthetic of the theme, where it looks like it does on your .md file. So that's not going to be changed for the theme but you can override it in your site if you prefer.

@Keats Keats closed this Oct 10, 2022
@apiraino
Copy link
Contributor Author

apiraino commented Oct 11, 2022

@Keats re: the margin/padding ok understood (I've just tried "upstreaming" my local change, I will keep it local)

But how about the <ol> item counting? That looks to me a strange behaviour indeed. Any comment on that? If this is not intended, I can reduce this patch to only removing the CSS on the <ol>

@Keats
Copy link
Collaborator

Keats commented Oct 11, 2022

Honestly I'm not sure. This is from the original theme.
Are you writing HTML in the .md file for the second ol list?

@apiraino
Copy link
Contributor Author

Are you writing HTML in the .md file for the second ol list?

I am using plain Markdown, here's the full snippet to reproduce the above first screenshot

+++
title = "Testing ordered lists fix"
date = 2022-10-10
category = "Prog"
+++

A missing space to separate text from the list item at the beginning of an ordered list:

1. First item
2.   Second item (leading spaces ignored)

I want to start the following list from an arbitrary number:

3. I want this to be the third item
4. I want this to be the fourth item

As mentioned in my previous comment, Zola renders the HTML correctly. It's just the after-dark theme CSS that is confusing the list numbering.

The original after-dark Hugo theme now lives on Codeberg (mirrored on github) and the CSS I'm removing is still there.

So, I think something's off in this theme but I also don't want to make it bigger than it is, I can live with a local fork that "Works For Me ™️ " if you're unsure about this patch.

@Keats
Copy link
Collaborator

Keats commented Oct 12, 2022

Yeah this part feels wrong for sure

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