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

Header icon_links show in separate rows, h3 heavy weight, 3rd column vert stretching #879

Open
dylanh724 opened this issue Nov 25, 2024 · 9 comments

Comments

@dylanh724
Copy link

dylanh724 commented Nov 25, 2024

This was great for a while -- but it no longer works (not sure when it broke. The latest 1.1.3 has this issue in both Sphinx 7 and 8). Seems that it has to do with .article-header-buttons class that's showing on separate rows.


image
^ The order gets jumbled if I add even 1 icon_links within html_theme_options

"icon_links": [
    {
        "name": "API Docs",
        "url": (
                "https://foo.com"
        ),
        "icon": "fa-solid fa-book-open",
        "attributes": {"target": "_self"},
    },
    {
        "name": "Discord",
        "url": "https://discord.gg/foo",
        "icon": "fa-brands fa-discord",
        "attributes": {"target": "_blank"},
    },
],

Originally posted by @dylanh724 in #833 (comment)

@dylanh724
Copy link
Author

dylanh724 commented Nov 25, 2024

image

I was looking back and forth to see what the heck was possibly different - here we go :) The above was in the old css, but not in new.

@dylanh724
Copy link
Author

Yep, that was it!
image

I added this to my arbitrary .css and it's back!

@dylanh724
Copy link
Author

dylanh724 commented Nov 25, 2024

Please keep this issue open, as I'm pretty curious how this could've happened. I even checked out an old tag -> built -> and it had these issues using the same ver. It was as an update was force-pushed in.

Additionally, I'm having other random CSS issues such as font-weight and a couple others that I suspect is due to the same source cause, but similar to this case, I can't explain really it.

@dylanh724
Copy link
Author

dylanh724 commented Nov 25, 2024

Another noticeable change is this one with the 3rd-column: The vert space is larger - or rather, it even looks like the text is stretched?

chrome_r3m8wmPBIM

image

If I inspect the element and snag a value, I can find it here at _toc_inpage.scss

@dylanh724
Copy link
Author

dylanh724 commented Nov 25, 2024

Adding

h3 {
    font-weight: normal;
}

worked around the other issue.

@RemDelaporteMathurin
Copy link

Yep, that was it! image

I added this to my arbitrary .css and it's back!

Do you mind writing here exactly what you added to your CSS styles pls?

@dylanh724
Copy link
Author

Do you mind writing here exactly what you added to your CSS styles pls?

For the icons:

#879 (comment)

For the font weight:

#879 (comment)

I didn't get to the vertically stretched 3rd column text

@dylanh724
Copy link
Author

Worked around the 3rd column vertical stretching, too. Here's everything combined:

/* 
SPHINX-BOOK-THEME HOTFIX (top-right icons): 
https://github.com/executablebooks/sphinx-book-theme/issues/879 
*/
.header-article__inner .header-article-items__end, .header-article__inner .header-article-items__start {
    align-items: start;
    display: flex;
    gap: .5rem;
}

/* 
SPHINX-BOOK-THEME HOTFIX (right column vertical stretching fix): 
https://github.com/executablebooks/sphinx-book-theme/issues/879 
*/
.toc-entry a.nav-link {
    padding: .125rem 0 .125rem 1rem;
}

/* 
h3 font weight fix (from extra heavy to normal):
https://github.com/executablebooks/sphinx-book-theme/issues/879 
*/
h3 {
    font-size: 125%;
    font-weight: normal;
}

@dylanh724 dylanh724 changed the title Header icon_links show in separate rows Header icon_links show in separate rows, h3 heavy weight, 3rd column vert stretching Nov 26, 2024
@dylanh724
Copy link
Author

I'm still mind-boggled as to how this happened when PyPi says the tagged version hasn't been updated since ~June?

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

No branches or pull requests

2 participants