Skip to content

Commit

Permalink
fix: updating spectrum-config to support new label styles
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe authored and Westbrook committed Feb 1, 2023
1 parent d88e2a9 commit cefeaad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 3 additions & 6 deletions packages/button/src/ButtonBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ export class ButtonBase extends LikeAnchor(
protected get buttonContent(): TemplateResult[] {
const content = [
html`
<div id="label" ?hidden=${!this.hasLabel}>
<slot
id="slot"
@slotchange=${this.manageTextObservedSlot}
></slot>
</div>
<span id="label" ?hidden=${!this.hasLabel}>
<slot @slotchange=${this.manageTextObservedSlot}></slot>
</span>
`,
];
if (this.hasIcon) {
Expand Down
2 changes: 1 addition & 1 deletion packages/button/src/spectrum-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ governing permissions and limitations under the License.
justify-self: center;
text-align: center;
}
#label:empty {
#label[hidden] {
display: none; /* .spectrum-Button-label:empty */
}
:host {
Expand Down
6 changes: 6 additions & 0 deletions packages/button/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ const config = {
excludeSourceSelector: [
/^(\.spectrum-Button.*),(\.spectrum-ClearButton.*),(\.spectrum-LogicButton.*)$/,
],
complexSelectors: [
{
replacement: '#label[hidden]',
selector: '.spectrum-Button-label:empty',
},
],
},
],
};
Expand Down

0 comments on commit cefeaad

Please sign in to comment.