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

Stylesheet: Avoid a second border below the main heading #4523

Closed
Larhzu opened this issue Dec 1, 2023 · 4 comments
Closed

Stylesheet: Avoid a second border below the main heading #4523

Larhzu opened this issue Dec 1, 2023 · 4 comments
Assignees
Labels
bug v2.0.21 Issues resolved in the 2.0.21 release
Milestone

Comments

@Larhzu
Copy link
Contributor

Larhzu commented Dec 1, 2023

These apply to both v2.0.x and main branches.

If <div class="details"> is missing when using :toc: left or :toc: right, an extra border is drawn below the main heading if the viewport is narrow (when the TOC is shown below the heading).

A minimal test case (use a narrow browser window):

:toc: left

= Foo

== Bar

It seems simple to fix based on toc vs. toc2 class:

-#header > h1:first-child + #toc {
+#header > h1:first-child + #toc.toc {

I tried to test that it doesn't break any other combinations and didn't find any issues but of course it's possbile that I missed a corner case still.

Unrelated but it's so tiny thing that I mention it here anyway: The following could be added for consistency with sup.footnote a:active (and #toc a:active).

#footnotes .footnote a:first-of-type:active {
  text-decoration: underline;
}

Thanks!

@mojavelinux
Copy link
Member

I agree that does look a bit odd...and it looks like it has been this way since at least the 1.5.x days. I'll see what we can do to clean that up.

Unrelated but it's so tiny thing that I mention it here anyway:

Please don't bundle issues.

@mojavelinux
Copy link
Member

The correct fix is to only draw the bottom border when the sidebar toc appears, which means the rule should be enclosed in the same media query. That way, the extra border won't be there when the toc is collapsed into the main content.

@mojavelinux mojavelinux self-assigned this Dec 2, 2023
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Dec 2, 2023
…ebar toc is collapsed into main content area
@mojavelinux mojavelinux added this to the v2.0.x milestone Dec 2, 2023
@Larhzu
Copy link
Contributor Author

Larhzu commented Dec 2, 2023

Your fix is definitely better. Thanks!

Please don't bundle issues.

I apologize. I won't do it again.

@mojavelinux
Copy link
Member

No worries. Thanks for noticing and reporting this issue!

@mojavelinux mojavelinux added the v2.0.21 Issues resolved in the 2.0.21 release label Dec 2, 2023
mojavelinux added a commit that referenced this issue Dec 2, 2023
…r toc is collapsed into main content area
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v2.0.21 Issues resolved in the 2.0.21 release
Projects
None yet
Development

No branches or pull requests

2 participants