reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
20.36k stars 1.17k forks source link

font_size doesn't work in accordion.item #3754

Open jq6l43d1 opened 7 months ago

jq6l43d1 commented 7 months ago

https://reflex.dev/docs/library/disclosure/accordion/ uses 'font_size="3em"' extensively as a prop of rx.accordion.item Like this:

rx.accordion.item(
    header="First Item",
    content="The first accordion item's content",
    font_size="3em",
),

However this has no effect on the font size of the header or the content. Here is an example of changing the font size of the header and the content that works:

rx.accordion.item(
    header=rx.text(
        "First Item", 
        font_size="3em"
    ),
    content=rx.text(
        "The first accordion item's content",
        font_size="4em"
    ),
),
masenf commented 3 months ago

maybe i'm missing it, but i'm not seeing 'font_size="3em"' in the current docs, anywhere on the page. i know we used to have that in there, but it was removed a few months back.

the way you have it written, applying the font_size to an rx.text component is the proper way to style the internals of the accordion.

we could probably update AccordionItem.create to not take arbitrary **props, because it's actually throwing most of them away anyway.

the problem is that rx.accordion_item is a composite component that creates a header, trigger, icon, and content, so it's not clear which component should receive the props that are passed to rx.accordion_item