update to the button if it has an icon in it's default slot (#1461)

This commit is contained in:
Kelsey Jackson
2025-09-18 08:42:38 -05:00
committed by GitHub
parent afe60eae69
commit 0beceff73f
2 changed files with 8 additions and 1 deletions

View File

@@ -183,6 +183,9 @@ Use the `start` and `end` slots to add presentational elements like `<wa-icon>`
Use the `with-caret` attribute to add a dropdown indicator when a button will trigger a dropdown, menu, or popover.
```html {.example}
<wa-button size="small" with-caret>
<wa-icon name="gear" label="Settings"></wa-icon>
</wa-button>
<wa-button size="small" with-caret>Small</wa-button>
<wa-button size="medium" with-caret>Medium</wa-button>
<wa-button size="large" with-caret>Large</wa-button>
@@ -251,4 +254,4 @@ This example demonstrates how to style buttons using a custom class. This is the
outline-offset: 4px;
}
</style>
```
```

View File

@@ -178,6 +178,10 @@
aspect-ratio: 1;
}
.button.is-icon-button:has(wa-icon) {
width: auto;
}
/* Pill modifier */
:host([pill]) .button {
border-radius: var(--wa-border-radius-pill);