Skip to content

Commit

Permalink
dev: Provide a button--ghost variant
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed Dec 11, 2024
1 parent a35d65c commit b1508f3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions assets/stylesheets/components/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,27 @@ button[disabled],
--button-background-color: var(--color-primary4);
}

.button--ghost {
--button-padding: var(--space-smaller) var(--space-small);
--button-background-color: transparent;
--button-color: var(--color-grey11);

font-weight: normal;

border: 1px solid transparent;
}

.button--ghost:not([disabled]):hover,
.button--ghost:not([aria-disabled]):hover,
.button--ghost:not([disabled]):focus,
.button--ghost:not([aria-disabled]):focus,
.button--ghost:not([disabled]):active,
.button--ghost:not([aria-disabled]):active {
--button-background-color: var(--color-grey4);

border-color: currentcolor;
}

.button--icon {
--button-padding: var(--space-small);

Expand Down
12 changes: 12 additions & 0 deletions docs/developers/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ Actually, this form is used for buttons that remove elements from a dynamic list
</button>
```

## Ghost button

Ghost buttons are similar to discreet buttons, but should be used only in places that already contain a lot of information.
Their border color is transparent by default, making them less intrusive.
They should only be used for secondary actions.

```html
<button class="button--ghost">
Edit
</button>
```

## Anchor button

It is possible to style buttons as links.
Expand Down

0 comments on commit b1508f3

Please sign in to comment.