mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-03 20:51:07 -05:00
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Followup to https://codeberg.org/forgejo/forgejo/pulls/9359. `templates/repo/issue/list.tmpl` had buttons changed which had `.disabled` on them conditionally. * adjust devtest page to have such buttons * implement `.disabled` for the newer buttons that does the same thing as the `.ui` buttons do: apply custom opacity, disable pointer events * this is the most boring way of implementing this Reported-by: @Gusted Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10410 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
107 lines
2.5 KiB
CSS
107 lines
2.5 KiB
CSS
/* Copyright 2024-2025 The Forgejo Authors. All rights reserved.
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
:root {
|
|
--button-min-height: 36px;
|
|
--button-padding-inline: 1.35rem;
|
|
}
|
|
|
|
:root .small:is(.button, .button-row, .button-sequence) {
|
|
--button-min-height: 34px;
|
|
--button-padding-inline: 1.25rem;
|
|
}
|
|
|
|
@media (pointer: coarse) {
|
|
:root {
|
|
--button-min-height: 40px;
|
|
}
|
|
|
|
:root .small:is(.button, .button-row, .button-sequence) {
|
|
--button-min-height: 38px;
|
|
}
|
|
}
|
|
|
|
.button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
min-height: var(--button-min-height);
|
|
padding-block: 0;
|
|
padding-inline: var(--button-padding-inline);
|
|
justify-content: center;
|
|
gap: 0.5rem;
|
|
border-radius: var(--border-radius);
|
|
font-weight: var(--font-weight-medium);
|
|
|
|
&:hover,
|
|
&:focus {
|
|
text-decoration: none;
|
|
}
|
|
|
|
&.disabled {
|
|
opacity: var(--opacity-disabled);
|
|
pointer-events: none;
|
|
}
|
|
}
|
|
|
|
.button.primary {
|
|
background: var(--color-primary);
|
|
color: var(--color-primary-contrast);
|
|
|
|
&:hover,
|
|
&:focus {
|
|
background-color: var(--color-primary-hover);
|
|
}
|
|
}
|
|
|
|
.button.secondary {
|
|
background: var(--color-button);
|
|
border: 1px solid var(--color-light-border);
|
|
color: var(--color-text-light);
|
|
|
|
&:hover,
|
|
&:focus {
|
|
color: var(--color-text);
|
|
}
|
|
}
|
|
|
|
.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));
|
|
}
|
|
}
|
|
|
|
/* Dropdown openers should be at least tall as buttons they are in line with, and
|
|
* as wide as they are tall */
|
|
:is(.button-row, .button-sequence) details.dropdown summary {
|
|
min-height: var(--button-min-height);
|
|
min-width: var(--button-min-height);
|
|
}
|
|
|
|
/* 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);
|
|
}
|
|
|
|
/* 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);
|
|
}
|
|
|
|
/* 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;
|
|
}
|
|
.button-sequence .ui.button {
|
|
margin: 0 !important;
|
|
}
|