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

FileDownload css not working with icons #6107

Closed
MarcSkovMadsen opened this issue Dec 21, 2023 · 2 comments · Fixed by #6133
Closed

FileDownload css not working with icons #6107

MarcSkovMadsen opened this issue Dec 21, 2023 · 2 comments · Fixed by #6133
Labels
regression type: bug Something isn't correct or isn't working
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

#6101 made it possible to adjust the height og the FileDownload. Unfortunately the icon and text is no longer aligned horizontally.

image

import panel as pn

pn.extension(design="bootstrap")

n=4

layout=pn.Column()

for i in range(n):
    row = pn.Row()
    layout.append(row)
    for j in range(n):
        download = pn.widgets.FileDownload(height=50+25*j, width=125+25*j, file=__file__, icon="download", button_type="primary")
        row.append(download)

layout.servable()
@MarcSkovMadsen MarcSkovMadsen added type: bug Something isn't correct or isn't working regression labels Dec 21, 2023
@MarcSkovMadsen MarcSkovMadsen added this to the next milestone Dec 21, 2023
@monodera
Copy link
Contributor

I had the same issue after upgrading to 1.3.6. It seems that display: inline; in .bk-btn a element will fix the issue.

import panel as pn

pn.extension(design="bootstrap")

n = 4

stylesheet = ".bk-btn a {display: inline;}"

layout = pn.Column()

for i in range(n):
    row = pn.Row()
    layout.append(row)
    for j in range(n):
        download = pn.widgets.FileDownload(
            height=50 + 25 * j,
            width=125 + 25 * j,
            file="script.py",
            icon="download",
            button_type="primary",
            stylesheets=[stylesheet],
        )
        row.append(download)

layout.servable()

Screenshot 2023-12-21 at 13 39 19

I don't know much about css, but maybe a better combination exists. FYI, inline-block does not work as expected inline flex may also be okay.

@philippjfr
Copy link
Member

Thank you both. Will try to get a 1.3.7 release out early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants