2025-10-04 23:22:32 -04:00
|
|
|
/* Copyright 2024-2025 The Forgejo Authors. All rights reserved.
|
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
2023-05-29 08:45:22 -04:00
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
:root {
|
|
|
|
|
--button-min-height: 36px;
|
|
|
|
|
--button-padding-inline: 1.35rem;
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-20 06:03:17 -04:00
|
|
|
:root .small:is(.button, .button-row, .button-sequence) {
|
2025-10-04 23:22:32 -04:00
|
|
|
--button-min-height: 34px;
|
|
|
|
|
--button-padding-inline: 1.25rem;
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
@media (pointer: coarse) {
|
|
|
|
|
:root {
|
|
|
|
|
--button-min-height: 40px;
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
|
2025-10-20 06:03:17 -04:00
|
|
|
:root .small:is(.button, .button-row, .button-sequence) {
|
2025-10-04 23:22:32 -04:00
|
|
|
--button-min-height: 38px;
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
.button {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
min-height: var(--button-min-height);
|
2025-10-10 01:11:53 -04:00
|
|
|
padding-block: 0;
|
2025-10-04 23:22:32 -04:00
|
|
|
padding-inline: var(--button-padding-inline);
|
|
|
|
|
justify-content: center;
|
2025-10-10 01:11:53 -04:00
|
|
|
gap: 0.5rem;
|
2023-06-09 04:37:47 -04:00
|
|
|
border-radius: var(--border-radius);
|
2025-10-27 19:10:38 -04:00
|
|
|
font-weight: var(--font-weight-medium);
|
2023-05-29 08:45:22 -04:00
|
|
|
|
2025-10-20 06:03:17 -04:00
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
.button.primary {
|
2023-05-29 08:45:22 -04:00
|
|
|
background: var(--color-primary);
|
2023-10-16 03:26:08 -04:00
|
|
|
color: var(--color-primary-contrast);
|
2023-05-29 08:45:22 -04:00
|
|
|
|
2025-10-20 06:03:17 -04:00
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
background-color: var(--color-primary-hover);
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
.button.secondary {
|
|
|
|
|
background: var(--color-button);
|
|
|
|
|
border: 1px solid var(--color-light-border);
|
|
|
|
|
color: var(--color-text-light);
|
2025-10-20 06:03:17 -04:00
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-20 06:03:17 -04:00
|
|
|
.button.danger {
|
|
|
|
|
/* Fallbacks are needed while -thin vars are not supplied by all themes */
|
|
|
|
|
background: var(--color-danger-bg, var(--color-error-bg));
|
|
|
|
|
border: 1px solid var(--color-thin-red, var(--color-red));
|
|
|
|
|
color: var(--color-thin-red, var(--color-red));
|
|
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
color: var(--color-thin-red-highlight, var(--color-red));
|
|
|
|
|
}
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
/* Dropdown openers should be at least tall as buttons they are in line with, and
|
|
|
|
|
* as wide as they are tall */
|
2025-10-20 06:03:17 -04:00
|
|
|
:is(.button-row, .button-sequence) details.dropdown summary {
|
2025-10-04 23:22:32 -04:00
|
|
|
min-height: var(--button-min-height);
|
|
|
|
|
min-width: var(--button-min-height);
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
/* button-row is a simple helper made to improve consistency of fomantic buttons
|
|
|
|
|
* placed in a row. It provides gap and cancels out fomantic's margins */
|
|
|
|
|
.button-row {
|
|
|
|
|
gap: var(--button-spacing);
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
/* button-sequence is a more complex helper that has wrap. Using it is preferred
|
|
|
|
|
* but also requires deeper consideration */
|
|
|
|
|
.button-sequence {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-flow: wrap;
|
|
|
|
|
gap: var(--button-spacing);
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:22:32 -04:00
|
|
|
/* Fomantic buttons have annoying margins to set distance between elements. In
|
|
|
|
|
* the button-row/sequence helpers this is set by flex+gap */
|
|
|
|
|
.button-row .ui.button {
|
|
|
|
|
margin-right: 0;
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|
2025-10-04 23:22:32 -04:00
|
|
|
.button-sequence .ui.button {
|
|
|
|
|
margin: 0 !important;
|
2023-05-29 08:45:22 -04:00
|
|
|
}
|