Update CodeBlock class to accept rx.color in custom_style
Type of change
- [X] Bug fix (non-breaking change which fixes an issue)
Changes the types accepted in the CodeBlock class (components/datadisplay/code.py) custom_style from Union[str, Var] to Union[str, Var, Color]. Fixes the issue where rx.color does not work in the markdown component map, at least for code blocks.
Includes one test under /tests/components/core/test_colors.py.
pytest passes the new tests, and there is one failure, although this was the case even before I made any changes.
A couple other changes were made with poetry run black reflex tests, which should not have any functional effect.
Fixes #2957 (hopefully)
As of a recent PR, we're not using black anymore (aside for .pyi files, but they're not edited manually anyway),
but ruff-format instead.
Run pre-commit on your PR to make it pass the tests.
Hopefully I've fixed the issue. Let me know if there's still any problems.
Edit: Made a few more changes. Now, hopefully I've actually fixed the issues...
The pre-commit check seems to be failing here, but it works on my end. Any ideas?
@khhan0130 I think you just need to run poetry run ruff --fix reflex. I tried to push to your PR but I got permission issues
@picklelo Thanks. Think the issue was that I didn't update reflex with poetry install, so ruff was getting a TOML parse error. Think it should be fixed now.