# # SPDX-FileCopyrightText: Hadad # SPDX-License-Identifier: Apache-2.0 # def styles(reasoning: str, content: str, expanded: bool = False) -> str: """ Generate a clean, interactive HTML
block that displays reasoning text inside a collapsible container with subtle styling and enhanced user experience, without applying any custom colors or shadows. This function creates a collapsible section using HTML and inline CSS that focuses on simplicity and readability. It avoids setting any custom text or background colors and does not include any box shadow effects, allowing the block to inherit colors and styles from its surrounding environment. The summary header includes a brain emoji represented by its HTML numeric character reference to symbolize reasoning. The collapsible block can be rendered initially expanded or collapsed based on the 'expanded' parameter. The 'content' parameter is unused but kept for compatibility with similar function signatures. Args: reasoning (str): The explanation or reasoning text to be displayed inside the collapsible block. This text is wrapped in a styled
for clear presentation. content (str): An unused parameter retained for compatibility with other functions sharing this signature. expanded (bool): If True, the collapsible block is initially open; if False, it starts closed. Returns: str: A complete HTML snippet string containing a
element with inline CSS that styles it as a simple, user-friendly collapsible container. The styling includes padding, rounded corners, smooth transitions on the summary header's text color, and readable font sizing without any color overrides or shadows. """ # Determine whether to include the 'open' attribute in the
tag. # If 'expanded' is True, the block will be rendered open by default in the browser. open_attr = "open" if expanded else "" # Define the brain emoji using its HTML numeric character reference to ensure consistent display # across different browsers and platforms, avoiding potential encoding issues. emoji = "🧠" # Unicode code point U+1F9E0 representing the 🧠 emoji # Construct and return the full HTML string for the collapsible block. # The
element acts as a toggleable container with padding and rounded corners for a modern look. # The inline styles avoid setting explicit colors or shadows, allowing the block to inherit styles from its context. # The element serves as the clickable header, featuring the brain emoji and the label "Reasoning". # It includes styling for font weight, size, cursor, and smooth color transitions on hover. # The hover effect is implemented using inline JavaScript event handlers that maintain the inherited color, # ensuring no color changes occur but allowing for potential future customization. # The reasoning text is wrapped inside a
with spacing and a subtle top border to visually separate it from the summary. # Typography settings improve readability with increased line height and slight letter spacing. # The 'content' parameter is intentionally unused but present to maintain compatibility with similar function signatures. return f"""
{emoji} Reasoning
{reasoning}
"""