Skip to content

Commit

Permalink
remove styled
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 committed Sep 26, 2024
1 parent f97871d commit 32397e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
6 changes: 2 additions & 4 deletions reflex/components/core/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ class Html(Div):
dangerouslySetInnerHTML: Var[Dict[str, str]]

@classmethod
def create(cls, *children, styled=False, **props):
def create(cls, *children, **props):
"""Create a html component.
Args:
*children: The children of the component.
styled: Whether the component should be styled with tailwind prose plugin.
**props: The props to pass to the component.
Returns:
Expand All @@ -41,9 +40,8 @@ def create(cls, *children, styled=False, **props):
given_class_name = props.pop("class_name", [])
if isinstance(given_class_name, str):
given_class_name = [given_class_name]
default_classes = ["rx-Html"] + (["prose"] if styled else [])
props["class_name"] = [
*default_classes,
"rx-Html",
*given_class_name,
]

Expand Down
2 changes: 0 additions & 2 deletions reflex/components/core/html.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class Html(Div):
def create( # type: ignore
cls,
*children,
styled=False,
dangerouslySetInnerHTML: Optional[
Union[Dict[str, str], Var[Dict[str, str]]]
] = None,
Expand Down Expand Up @@ -91,7 +90,6 @@ class Html(Div):
Args:
*children: The children of the component.
styled: Whether the component should be styled with tailwind prose plugin.
dangerouslySetInnerHTML: The HTML to render.
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
Expand Down
9 changes: 0 additions & 9 deletions tests/components/core/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ def test_html_create():
)


def test_html_styled_create():
html = Html.create("<p>Hello !</p>", styled=True)
assert str(html.dangerouslySetInnerHTML) == '({ ["__html"] : "<p>Hello !</p>" })' # type: ignore
assert (
str(html)
== '<div className={"rx-Html prose"} dangerouslySetInnerHTML={({ ["__html"] : "<p>Hello !</p>" })}/>'
)


def test_html_fstring_create():
class TestState(State):
"""The app state."""
Expand Down

0 comments on commit 32397e9

Please sign in to comment.