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

[BUG] set_pico_cls() Fails to Add Classes in Jupyter Notebook Output #631

Open
4 tasks done
Zaseem-BIsquared opened this issue Jan 10, 2025 · 0 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@Zaseem-BIsquared
Copy link

Describe the Problem

In Jupyter Notebook, when I use set_pico_cls() along with show(picocondlink) to apply Pico styling, the expected styling doesn’t show up in the output

Steps to Reproduce

Here’s a simple example to show the issue:

from fasthtml.common import *
show(picocondlink)
set_pico_cls()
show(Titled("Greeting", Div(P("Hello  World!")), Button("Hello")))

What I Expected

I was expecting set_pico_cls() to automatically apply the pico class to the elements, but it didn’t.

Workaround I Found

As a temporary fix, I used this helper function to manually apply the pico class:

def show_with_pico(*args):
    return show(Div(*args, cls="pico"))

It’s not ideal, but it works for now.

Environment Details

Here are the versions of the libraries I’m using:

  • fastlite: 0.1.1
  • fastcore: 1.7.28
  • fasthtml: 0.11.0

Confirmation Checklist

  • I’ve checked the [FAQ](https://docs.fastht.ml/explains/faq.html) to see if this is a known issue.
  • I’ve included a minimal example to reproduce the problem.
  • I’ve provided the library versions I’m using.
  • I understand this is a volunteer-driven open-source project.

Screenshot of the Problem

Output Screenshot

@Zaseem-BIsquared Zaseem-BIsquared added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant