# # SPDX-FileCopyrightText: Hadad # SPDX-License-Identifier: Apache-2.0 # def styles(reasoning: str, content: str, expanded: bool = False) -> str: """ Create a visually captivating and interactive HTML
block that elegantly presents reasoning text inside a beautifully styled collapsible container with enhanced user experience features. This function generates a sophisticated collapsible section using HTML and inline CSS, designed to grab attention with a modern, polished look. It leverages subtle shadows, smooth transitions, and vibrant styling to make the reasoning content stand out while maintaining excellent readability on dark backgrounds. The container uses the default background color to blend seamlessly with its surroundings, ensuring versatility in different UI contexts. The summary header includes an engaging emoji and changes color on hover to invite user interaction. The reasoning text is carefully spaced and styled with a clean font and crisp white color for maximum clarity. The collapsible block can start expanded or collapsed based on the 'expanded' parameter. The 'content' parameter remains unused here to keep the function signature consistent with similar functions. Args: reasoning (str): The main explanation or reasoning text to be displayed inside the collapsible block. This content is wrapped in a styled
for clear presentation. content (str): An unused parameter retained for compatibility with other functions sharing this signature. expanded (bool): Determines if the collapsible block is initially open (True) or closed (False) when rendered. Returns: str: A complete HTML snippet string containing a
element with inline CSS that styles it as a sleek, interactive collapsible container. The styling includes padding, rounded corners, a subtle but dynamic shadow, smooth hover effects on the summary header, and carefully sized fonts with white text for optimal contrast and readability. """ # Conditionally add the 'open' attribute to the
element if expanded is True, # so the block starts expanded when rendered in the browser. open_attr = "open" if expanded else "" # Return the full HTML string with inline CSS styles applied to create an eye-catching, user-friendly collapsible block. # The
element acts as a toggleable container with smooth rounded corners and a dynamic shadow that subtly intensifies on hover. # The element serves as the clickable header with a brain emoji to visually represent reasoning, # featuring a color transition on hover to encourage user interaction. # The reasoning text is enclosed in a
with generous spacing, a delicate top border, and crisp white text for excellent readability. # The entire block uses a clean, modern sans-serif font and avoids any background color override to maintain design flexibility. return f"""
🧠 Reasoning
{reasoning}
"""