Skip to content

Conversation

@rxtsel
Copy link
Contributor

@rxtsel rxtsel commented May 16, 2025

Refactor and Improvement of the Container Component

Summary

  • Enhances the flexibility of the Container component by requiring the as prop to specify semantic HTML tags, following the recommended conventions for polymorphic components.
  • Simplifies the markup structure by reducing unnecessary nesting across multiple views.
  • The as prop is restricted to semantic container tags (div, section, article, etc.) to ensure consistent use aligned with the component’s role as a layout container. You can see all available tags here: https://github.com/coderdiaz-studio/cvfolio/blob/6877032ae38fb9ca1d660a5b1b859f42e776f281/src/components/Container.astro#L3
  • The main tag is intentionally excluded because it is already used in the BaseLayout.astro component to wrap the entire page, preventing redundant markup.

@rxtsel rxtsel requested a review from coderdiaz May 20, 2025 01:47
@rxtsel rxtsel changed the title refactor: enhance Container component with tag prop for better semantic markup refactor: enhance Container component with as prop for better semantic markup May 20, 2025
Copy link
Owner

@coderdiaz coderdiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @rxtsel 💛

@coderdiaz
Copy link
Owner

:shipit:

@coderdiaz coderdiaz merged commit 50d2f07 into coderdiaz:main May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants