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

Expose spinner part on tree item #1937

Merged

Conversation

mwalklandIDBS
Copy link
Contributor

Other components that use the spinner (like button and menu item) expose the spinner part to allow for customisation. This just adds the same behaviour for the tree item.

My use-case for this is to customise the colour of the tree item spinner.

Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview Mar 25, 2024 2:52pm

@mwalklandIDBS mwalklandIDBS marked this pull request as draft March 22, 2024 11:44
@mwalklandIDBS mwalklandIDBS marked this pull request as ready for review March 22, 2024 15:40
@@ -257,7 +258,7 @@ export default class SlTreeItem extends ShoelaceElement {
})}
aria-hidden="true"
>
${when(this.loading, () => html` <sl-spinner></sl-spinner> `)}
${when(this.loading, () => html` <sl-spinner part="spinner"></sl-spinner> `)}
Copy link
Member

@claviska claviska Mar 25, 2024

Choose a reason for hiding this comment

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

Thanks for the PR!

When exposing a part, we want to make sure we expose "sub-parts" too, so this needs something like exportparts="base:spinner__base" per these guidelines and another @csspart entry.

For reference, spinner parts can be found here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added!

@claviska claviska merged commit acf76cf into shoelace-style:next Mar 25, 2024
1 check passed
@mwalklandIDBS mwalklandIDBS deleted the expose-spinner-part-in-tree-item branch March 25, 2024 15:00
@mwalklandIDBS
Copy link
Contributor Author

@claviska Thank you for reviewing and releasing so fast! Appreciate it

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.

None yet

2 participants