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

bugfix: allow different styles in button groups #1920

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions packages/plugin/src/styles/components/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@
/* === Button Groups === */

.btn-group {
@apply inline-flex flex-row space-x-0 overflow-hidden rounded-token;
@apply inline-flex overflow-hidden space-x-0 rounded-token;
/* Safari: hover overflow fix for border radius */
isolation: isolate;
/* isolation: isolate; */
}
.btn-group-vertical {
@apply btn-group flex-col space-y-0 rounded-container-token;
@apply inline-flex flex-col overflow-hidden space-0 rounded-container-token;
/* Safari: hover overflow fix for border radius */
isolation: isolate;
}
Expand All @@ -95,9 +95,23 @@
.btn-group a,
.btn-group-vertical button,
.btn-group-vertical a {
@apply button-base-styles hover:bg-surface-50/[3%] active:bg-surface-900/[3%];
@apply button-base-styles hover:bg-blend-lighten active:bg-blend-darken !border-0;
/* Reset Anchor Styles */
@apply !no-underline !text-inherit;
@apply !no-underline;
}

/* Horizontal Button / Anchors */
.btn-group button,
.btn-group a {
/* Handle rounding of first and last button */
@apply first:rounded-tl-token first:rounded-bl-token last:rounded-tr-token last:rounded-br-token;
}

/* Vertical Button / Anchors */
.btn-group-vertical button,
.btn-group-vertical a {
/* Handle rounding of first and last button */
@apply first:rounded-tl-container-token first:rounded-tr-container-token last:rounded-bl-container-token last:rounded-br-container-token;
}

/* Set Neutral Divider */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,81 @@
<button>Days</button>
<button>Years</button>
</div>
`}
/>
</svelte:fragment>
</DocsPreview>
<p>Button groups with different styles</p>
<DocsPreview background="neutral">
<svelte:fragment slot="preview">
<div class="flex flex-col gap-8">
<div class="btn-group">
<button class="variant-filled-primary">Create</button>
<button class="variant-filled-success">Read</button>
<button class="variant-filled-warning">Update</button>
<button class="variant-filled-error">Delete</button>
</div>
<div class="btn-group">
<button class="variant-ghost-primary">Create</button>
<button class="variant-ghost-success">Read</button>
<button class="variant-ghost-warning">Update</button>
<button class="variant-ghost-error">Delete</button>
</div>
<div class="btn-group">
<button class="variant-soft-primary">Create</button>
<button class="variant-soft-success">Read</button>
<button class="variant-soft-warning">Update</button>
<button class="variant-soft-error">Delete</button>
</div>
</div>
</svelte:fragment>
<svelte:fragment slot="source">
<CodeBlock
language="html"
code={`
<div class="btn-group">
<button class="variant-filled-primary">Create</button>
<button class="variant-filled-success">Read</button>
<button class="variant-filled-warning">Update</button>
<button class="variant-filled-error">Delete</button>
</div>
`}
/>
</svelte:fragment>
</DocsPreview>
<DocsPreview background="neutral">
<svelte:fragment slot="preview">
<div class="flex gap-8">
<div class="btn-group-vertical">
<button class="variant-filled-primary">Create</button>
<button class="variant-filled-success">Read</button>
<button class="variant-filled-warning">Update</button>
<button class="variant-filled-error">Delete</button>
</div>
<div class="btn-group-vertical">
<button class="variant-ghost-primary">Create</button>
<button class="variant-ghost-success">Read</button>
<button class="variant-ghost-warning">Update</button>
<button class="variant-ghost-error">Delete</button>
</div>
<div class="btn-group-vertical">
<button class="variant-soft-primary">Create</button>
<button class="variant-soft-success">Read</button>
<button class="variant-soft-warning">Update</button>
<button class="variant-soft-error">Delete</button>
</div>
</div>
</svelte:fragment>
<svelte:fragment slot="source">
<CodeBlock
language="html"
code={`
<div class="btn-group-vertical">
<button class="variant-filled-primary">Create</button>
<button class="variant-filled-success">Read</button>
<button class="variant-filled-warning">Update</button>
<button class="variant-filled-error">Delete</button>
</div>
`}
/>
</svelte:fragment>
Expand Down
Loading