mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-18 22:57:51 -05:00
fix(ui): make relative time consistent with other text when selected (#11231)
Defines new css colours for theming: ```css --color-selection-bg: var(--color-primary-light-1); --color-selection-fg: var(--color-white); ``` which are then used both in the `base.css` and in the relative-time shadow object. This, is how it looks for me when selecting before and after this patch (my Browser’s accent colour used for selection is orange): | | Before | After | |---|---|---| | Forgejo Light |  |  | | Forgejo Dark | |  | | Gitea Light |  |  | | Gitea Dark |  |  | Co-authored-by: 0ko <0ko@noreply.codeberg.org> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11231 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Robert Wolff <mahlzahn@posteo.de> Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
This commit is contained in:
parent
92cb4ca019
commit
5470fd0131
6 changed files with 13 additions and 11 deletions
|
|
@ -242,9 +242,10 @@ h1.error-code {
|
|||
background: var(--color-hover);
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--color-primary-light-1);
|
||||
color: var(--color-white);
|
||||
::selection,
|
||||
relative-time::part(relative-time)::selection {
|
||||
background: var(--color-selection-bg);
|
||||
color: var(--color-selection-fg);
|
||||
}
|
||||
|
||||
::placeholder,
|
||||
|
|
|
|||
|
|
@ -276,6 +276,8 @@
|
|||
--color-highlight-fg: var(--color-primary-light-4);
|
||||
--color-highlight-bg: var(--color-primary-alpha-20);
|
||||
--color-overlay-backdrop: #080808c0;
|
||||
--color-selection-bg: var(--steel-100);
|
||||
--color-selection-fg: var(--color-pure-black);
|
||||
/* pattern colors for image diff */
|
||||
--checkerboard-color-1: #474747;
|
||||
--checkerboard-color-2: #313131;
|
||||
|
|
@ -338,10 +340,6 @@ i.grey.icon.icon.icon.icon {
|
|||
.ui.yellow.label.pending-label {
|
||||
color: var(--color-warning-text) !important;
|
||||
}
|
||||
::selection {
|
||||
background: var(--steel-100) !important;
|
||||
color: var(--color-pure-black) !important;
|
||||
}
|
||||
strong.attention-important, svg.attention-important {
|
||||
color: var(--color-violet-light);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,8 @@
|
|||
--color-highlight-fg: var(--color-primary-light-4);
|
||||
--color-highlight-bg: var(--color-primary-light-6);
|
||||
--color-overlay-backdrop: #080808c0;
|
||||
--color-selection-bg: var(--steel-450);
|
||||
--color-selection-fg: var(--color-white);
|
||||
/* pattern colors for gradient */
|
||||
--checkerboard-color-1: #ffffff;
|
||||
--checkerboard-color-2: #e5e5e5;
|
||||
|
|
@ -309,7 +311,3 @@
|
|||
background: var(--color-warning-bg) !important;
|
||||
color: var(--color-text-dark) !important;
|
||||
}
|
||||
::selection {
|
||||
background: var(--steel-450) !important;
|
||||
color: var(--color-white) !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,6 +234,8 @@
|
|||
--color-highlight-fg: #87651e;
|
||||
--color-highlight-bg: #352c1c;
|
||||
--color-overlay-backdrop: #080808c0;
|
||||
--color-selection-bg: var(--color-primary-light-1);
|
||||
--color-selection-fg: var(--color-white);
|
||||
/* pattern colors for image diff */
|
||||
--checkerboard-color-1: #313131;
|
||||
--checkerboard-color-2: #212121;
|
||||
|
|
|
|||
|
|
@ -234,6 +234,8 @@
|
|||
--color-highlight-fg: #eed200;
|
||||
--color-highlight-bg: #fffbdd;
|
||||
--color-overlay-backdrop: #080808c0;
|
||||
--color-selection-bg: var(--color-primary-light-1);
|
||||
--color-selection-fg: var(--color-white);
|
||||
/* pattern colors for gradient */
|
||||
--checkerboard-color-1: #ffffff;
|
||||
--checkerboard-color-2: #e5e5e5;
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ window.customElements.define('relative-time', class extends HTMLElement {
|
|||
if (!this.shadowRoot) {
|
||||
this.attachShadow({mode: 'open'});
|
||||
this.contentSpan = document.createElement('span');
|
||||
this.contentSpan.setAttribute('part', 'relative-time');
|
||||
this.shadowRoot.append(this.contentSpan);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue