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

Make icons look better in value boxes #8

Merged
merged 4 commits into from
Dec 28, 2023
Merged

Conversation

cpsievert
Copy link
Collaborator

This PR makes icon_svg() look much better inside a shiny value_box(), for example:

import faicons as fa
from shiny.express import ui

with ui.value_box(showcase=fa.icon_svg("gear")):
    "A value box"
    "With a value"

Before

Screenshot 2023-12-28 at 5 29 55 PM

After

Screenshot 2023-12-28 at 5 29 35 PM

It does this by including a class="fa" to the <svg> markup, which {bslib} will recognize as a fontawesome icon, and thus add the gradient and font-size style.

@cpsievert cpsievert changed the title Add fa class and don't add font-size inline style Make icons look better in value boxes Dec 28, 2023
faicons/_core.py Outdated Show resolved Hide resolved
@cpsievert cpsievert merged commit 5371198 into main Dec 28, 2023
4 checks passed
@cpsievert cpsievert deleted the font-size-gradient branch December 28, 2023 23:58
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.

1 participant