From 2c4310d9ff4136416bbfe7e255a3d7ab610ccac7 Mon Sep 17 00:00:00 2001 From: Andrew Davies <6566948+minimav@users.noreply.github.com> Date: Tue, 24 Sep 2024 02:18:05 +0100 Subject: [PATCH] Use tailwind typography plugin by default (#3593) Co-authored-by: Khaleel Al-Adhami --- reflex/components/core/html.py | 2 +- reflex/config.py | 2 +- tests/components/core/test_html.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/components/core/html.py b/reflex/components/core/html.py index cfe46e591..a732e7828 100644 --- a/reflex/components/core/html.py +++ b/reflex/components/core/html.py @@ -40,7 +40,7 @@ class Html(Div): given_class_name = props.pop("class_name", []) if isinstance(given_class_name, str): given_class_name = [given_class_name] - props["class_name"] = ["rx-Html", *given_class_name] + props["class_name"] = ["rx-Html", "prose", *given_class_name] # Create the component. return super().create(**props) diff --git a/reflex/config.py b/reflex/config.py index 06d8c2193..fadd82482 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -194,7 +194,7 @@ class Config(Base): cors_allowed_origins: List[str] = ["*"] # Tailwind config. - tailwind: Optional[Dict[str, Any]] = {} + tailwind: Optional[Dict[str, Any]] = {"plugins": ["@tailwindcss/typography"]} # Timeout when launching the gunicorn server. TODO(rename this to backend_timeout?) timeout: int = 120 diff --git a/tests/components/core/test_html.py b/tests/components/core/test_html.py index 4847e1d5a..cc6530cb6 100644 --- a/tests/components/core/test_html.py +++ b/tests/components/core/test_html.py @@ -19,7 +19,7 @@ def test_html_create(): assert str(html.dangerouslySetInnerHTML) == '({ ["__html"] : "

Hello !

" })' # type: ignore assert ( str(html) - == '
Hello !

" })}/>' + == '
Hello !

" })}/>' ) @@ -37,5 +37,5 @@ def test_html_fstring_create(): ) assert ( str(html) - == f'
' # type: ignore + == f'
' # type: ignore )