Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #101 from modrinth/feature/joined-buttons
Browse files Browse the repository at this point in the history
Joined buttons
  • Loading branch information
Prospector authored Oct 16, 2023
2 parents ffb491a + 6fb04e2 commit 5e4c261
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 452 deletions.
50 changes: 50 additions & 0 deletions docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,53 @@
<Button icon-only transparent><SunIcon /></Button>
<Button icon-only transparent><DropdownIcon /></Button>
```

## Joined buttons

<DemoContainer>
<div class="joined-buttons">
<Button color="primary"><UploadIcon /> Upload</Button>
<OverflowMenu :options="[
{
'id': 'import',
'action': () => {},
},
{
'id': 'edit',
'action': () => {}
}
]" class="btn btn-primary btn-dropdown-animation icon-only">
<DropdownIcon />
<template #import>
<ImportIcon /> Import
</template>
<template #edit>
<EditIcon /> Edit
</template>
</OverflowMenu>
</div>
</DemoContainer>

```vue
<div class="joined-buttons">
<Button color="primary"><UploadIcon /> Upload</Button>
<OverflowMenu :options="[
{
'id': 'import',
'action': () => {},
},
{
'id': 'edit',
'action': () => {}
}
]" class="btn btn-primary btn-dropdown-animation icon-only">
<DropdownIcon />
<template #import>
<ImportIcon /> Import
</template>
<template #edit>
<EditIcon /> Edit
</template>
</OverflowMenu>
</div>
```
118 changes: 0 additions & 118 deletions docs/components/dropdown-button.md

This file was deleted.

1 change: 1 addition & 0 deletions lib/assets/icons/import.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions lib/assets/styles/classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,18 @@ a,
background: none;
box-shadow: none;
}

&.btn-dropdown-animation {
svg {
transition: transform 0.125s ease-in-out;
}

&.popout-open {
svg {
transform: rotate(180deg);
}
}
}
}

.btn-group {
Expand All @@ -494,6 +506,27 @@ a,
flex-wrap: wrap;
}

.joined-buttons {
display: flex;
gap: 1px;

> :not(:first-child) {
&.btn,
> .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}

> :not(:last-child) {
&.btn,
> .btn {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
}

// PROJECT CARDS

.project-list {
Expand Down
Loading

0 comments on commit 5e4c261

Please sign in to comment.