"""Custom CSS for the GESDA KG Explorer.""" from __future__ import annotations import streamlit as st from queries.schema import NODE_COLORS def inject_css() -> None: badge_rules = "\n".join( f'.badge-{label.replace(" ", "-")} ' f'{{ background-color: {color}22; color: {color}; border: 1px solid {color}55; }}' for label, color in NODE_COLORS.items() ) st.markdown( f""" """, unsafe_allow_html=True, ) def node_badge(label: str) -> str: css_class = f"badge badge-{label.replace(' ', '-')}" return f'{label}' def score_bar(score: float, color: str = "#3498db") -> str: pct = int(score * 100) return ( f'
' )