Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend composite components from shoelace web components #23

Merged
merged 1 commit into from
May 27, 2024

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Apr 16, 2024

  • I was creating a radio-btn-group component and found myself writing too much boilerplate.
  • Shoelace.style has some fantastic low level components already designed.
  • Instead of creating all of these low level components, I thought we could extend shoelace, passing in our style/theme, and creating composite components (header, footer, toolbar, sidebar, etc).
  • Then we can have a HOT layout fully formed around the edge of the screen, with the viewport in the center being for the page content.
  • This worked for all examples: svelte, vue, react.

Todo

Testing

pnpm install
pnpm run build
cd examples/react
pnpm install
pnpm run dev

View the react toolbar at http://localhost:3000

@spwoodcock spwoodcock added the enhancement New feature or request label Apr 16, 2024
@spwoodcock spwoodcock requested review from emi420 and JoltCode April 16, 2024 21:03
@spwoodcock spwoodcock self-assigned this Apr 16, 2024
@github-actions github-actions bot added documentation Improvements or additions to documentation dependency labels Apr 16, 2024
@JoltCode
Copy link
Collaborator

@spwoodcock I've just had a thought - I think we could use UnoCSS instead? UnoCSS support the ::part syntax, which would solve the issue that would prevent us from using TailwindCSS. And, we're already using UnoCSS for the web component styling, so it's good that it should work with styling the shoelace components too!

https://unocss.dev/integrations/vite#part-built-in-support

@spwoodcock
Copy link
Member Author

Fantastic idea 😁

I was a bit hung up on using Tailwind, but Uno is fantastic & we can use exactly the same syntax as Tailwind if I'm not mistaken.

It's a seamless transition!

Copy link
Collaborator

@JoltCode JoltCode left a comment

Choose a reason for hiding this comment

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

All looks great - we just need to migrate to UnoCSS now! 👍

Also, we should probably add a classnames prop, which can be used to add classrooms to specific children of the parent component? I've seen this with other UI libs, and seems good 😄

@spwoodcock
Copy link
Member Author

Completely agree!

I think the code for adding extra class names may still be there, but just commented out. If no, it's easy to add back in.

I won't have much time to work in this over the next few days, but plan to put in a big shift when I'm back from holidays in May 😄

Ideally we will use this components immediately in the drone tasking manager, with the header probably being the most crucial to start 👍

@JoltCode
Copy link
Collaborator

Completely agree!

I think the code for adding extra class names may still be there, but just commented out. If no, it's easy to add back in.

I won't have much time to work in this over the next few days, but plan to put in a big shift when I'm back from holidays in May 😄

Ideally we will use this components immediately in the drone tasking manager, with the header probably being the most crucial to start 👍

Oh awesome - will take a look!

No worries, chat on Monday, hope you have a great weekend! 😄

And that's great, sounds like a plan! 🚀

@spwoodcock
Copy link
Member Author

Merging this to make a temp release.

We can work on adding UnoCSS & adding a classnames prop in another PR 👍

@spwoodcock spwoodcock merged commit f984af8 into main May 27, 2024
2 checks passed
@spwoodcock spwoodcock deleted the feat/shoelace branch May 27, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants