Spaces:
Runtime error
Runtime error
Add WCAG texts
Browse files- fragments.py +7 -0
fragments.py
CHANGED
@@ -12,6 +12,13 @@ def contrast_summary(label: str, foreground_rgb_hex: str, background_rgb_hex: st
|
|
12 |
|
13 |
st.metric(label, value=f"{contrast_ratio_str} : 1", label_visibility="collapsed")
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
st.markdown(f'<p style="color: {foreground_rgb_hex}; background-color: {background_rgb_hex}; padding: 12px">Lorem ipsum</p>', unsafe_allow_html=True)
|
16 |
|
17 |
|
|
|
12 |
|
13 |
st.metric(label, value=f"{contrast_ratio_str} : 1", label_visibility="collapsed")
|
14 |
|
15 |
+
if contrast.passes_AAA(contrast_ratio):
|
16 |
+
st.markdown(":white_check_mark: :white_check_mark: WCAG AAA")
|
17 |
+
elif contrast.passes_AA(contrast_ratio):
|
18 |
+
st.markdown(":white_check_mark: WCAG AA")
|
19 |
+
else:
|
20 |
+
st.markdown(":x: Fail WCAG")
|
21 |
+
|
22 |
st.markdown(f'<p style="color: {foreground_rgb_hex}; background-color: {background_rgb_hex}; padding: 12px">Lorem ipsum</p>', unsafe_allow_html=True)
|
23 |
|
24 |
|