rx.logo: make it accessible to screen readers
Add role="img" aria_label="Reflex" and title="Reflex".
This commit is contained in:
parent
c64ed43215
commit
c6d874ae99
@ -5,11 +5,15 @@ from typing import Union
|
|||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
|
|
||||||
def svg_logo(color: Union[str, rx.Var[str]] = rx.color_mode_cond("#110F1F", "white")):
|
def svg_logo(
|
||||||
|
color: Union[str, rx.Var[str]] = rx.color_mode_cond("#110F1F", "white"),
|
||||||
|
**props,
|
||||||
|
):
|
||||||
"""A Reflex logo SVG.
|
"""A Reflex logo SVG.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
color: The color of the logo.
|
color: The color of the logo.
|
||||||
|
props: Extra props to pass to the svg component.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The Reflex logo SVG.
|
The Reflex logo SVG.
|
||||||
@ -31,11 +35,14 @@ def svg_logo(color: Union[str, rx.Var[str]] = rx.color_mode_cond("#110F1F", "whi
|
|||||||
|
|
||||||
return rx.el.svg(
|
return rx.el.svg(
|
||||||
*[logo_path(d) for d in paths],
|
*[logo_path(d) for d in paths],
|
||||||
width="56",
|
rx.el.title("Reflex"),
|
||||||
height="12",
|
aria_label="Reflex",
|
||||||
viewBox="0 0 56 12",
|
role="img",
|
||||||
|
width=props.pop("width", "56"),
|
||||||
|
height=props.pop("height", "12"),
|
||||||
fill=color,
|
fill=color,
|
||||||
xmlns="http://www.w3.org/2000/svg",
|
xmlns="http://www.w3.org/2000/svg",
|
||||||
|
**props,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user