Skip to content

Commit d5c3b82

Browse files
committed
Adds split grouping to button-container
1 parent ae4c598 commit d5c3b82

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/webviews/apps/plus/home/components/launchpad.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
147147
<gl-section ?loading=${this._summaryState.computed.status === 'pending'}>
148148
<span slot="heading">Launchpad</span>
149149
<div class="summary">${this.renderSummaryResult()}</div>
150-
<button-container gap="wide">
150+
<button-container grouping="gap-wide">
151151
<gl-button full class="start-work" href=${this.startWorkCommand}>Start Work on an Issue</gl-button>
152152
<gl-button
153153
appearance="secondary"

src/webviews/apps/shared/components/button-container.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export class ButtonContainer extends LitElement {
99
css`
1010
:host {
1111
--button-group-gap: 0.4rem;
12-
--button-group-wide-gap: 1rem;
1312
display: block;
1413
max-width: 30rem;
1514
margin-right: auto;
@@ -18,6 +17,14 @@ export class ButtonContainer extends LitElement {
1817
transition: max-width 0.2s ease-out;
1918
}
2019
20+
:host([grouping='gap-wide']) {
21+
--button-group-gap: 1rem;
22+
}
23+
24+
:host([grouping='split']) {
25+
--button-group-gap: 0.1rem;
26+
}
27+
2128
@media (min-width: 640px) {
2229
:host(:not([editor])) {
2330
max-width: 100%;
@@ -26,13 +33,18 @@ export class ButtonContainer extends LitElement {
2633
2734
.group {
2835
display: inline-flex;
29-
gap: var(--button-group-gap);
36+
gap: var(--button-group-gap, 0.4rem);
3037
width: 100%;
3138
max-width: 30rem;
3239
}
3340
34-
:host([gap='wide']) .group {
35-
gap: var(--button-group-wide-gap);
41+
:host([grouping='split']) ::slotted(*:not(:first-child)) {
42+
border-top-left-radius: 0;
43+
border-bottom-left-radius: 0;
44+
}
45+
:host([grouping='split']) ::slotted(*:not(:last-child)) {
46+
border-top-right-radius: 0;
47+
border-bottom-right-radius: 0;
3648
}
3749
`,
3850
];
@@ -43,6 +55,9 @@ export class ButtonContainer extends LitElement {
4355
@property({ reflect: true })
4456
gap?: 'wide';
4557

58+
@property({ reflect: true })
59+
grouping?: 'gap' | 'split' | 'gap-wide' = 'gap';
60+
4661
override render(): unknown {
4762
return html`<div class="group"><slot></slot></div>`;
4863
}

0 commit comments

Comments
 (0)