Custom Tag names (e.g. foo-menu-item, foo-carousel-item) #2368
jorenbroekema
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think this is really interesting. However, it does not work out completely because there are also occurrences of components directly in the render function, e.g. https://github.com/shoelace-style/shoelace/blob/next/src/components/breadcrumb/breadcrumb.component.ts#L96. You would have to use dynamic rendering for each of those cases :( |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Similar to #705 but it's pretty old and got closed.
While it's nice that we can import just the class and register with our own tag name, it doesn't really fix the issue that there's a lot of hard coupling in components with other components' tag names.
Examples:
While I appreciate that Shoelace is mostly made extendible through CSS parts and theming, there are often use cases for extending the class, creating overrides or additions. While you can still use the original tag name, there's use cases for using a different tag name, for 2 reasons for me personally:
Suggestion
Elements that have some kind of coupling to other CE names to use an overridable (protected accessor) getter that returns a map of CE names (below is just pseudo code to illustrate):
Then the extender can do:
Let me know if you'd be interested this, I'm happy to start a PR, maybe for 1 component per PR at a time to keep things easy to review, maybe to a specific branch until we finish it for all comps that require it?
Beta Was this translation helpful? Give feedback.
All reactions