0
Fork 0
mirror of https://projects.blender.org/infrastructure/gitea-custom.git synced 2025-01-03 05:10:05 -05:00

CSS: Refactor

* Convert hex colors to hsl for easier tweaking.
* Add comments and sections
* Tweak colors to better follow code.blender.org
This commit is contained in:
Pablo Vazquez 2023-01-20 19:16:29 +01:00
parent 1e38c726dc
commit 58816d3e27

View file

@ -3,11 +3,27 @@
:root { :root {
--is-dark-theme: true; --is-dark-theme: true;
--color-primary: hsl(198deg 90% 56%); /* Spacing. */
--spacer: 1rem;
--spacer-1: .25rem;
--spacer-2: .5rem;
--spacer-3: var(--spacer);
--spacer-4: 1.5rem;
--spacer-5: 3rem;
/* Borders. */
--border-radius: .33rem;
--border-radius-outer: .28571429rem;
/* Transitions. */
--transition-speed: 150ms;
/* Colors. */
color-scheme: dark;
--color-primary: hsl(198deg 90% 56%);
--color-primary-bg: hsla(198deg, 100%, 36%, .2); --color-primary-bg: hsla(198deg, 100%, 36%, .2);
--color-primary-contrast: #ffffff; --color-primary-contrast: hsl(0, 0%, 100%);
--color-primary-dark-1: hsl(198deg 100% 54%); --color-primary-dark-1: hsl(198deg 100% 54%);
--color-primary-dark-2: hsl(198deg 100% 64%); --color-primary-dark-2: hsl(198deg 100% 64%);
--color-primary-dark-3: hsl(198deg 100% 70%); --color-primary-dark-3: hsl(198deg 100% 70%);
@ -34,185 +50,177 @@
--color-primary-alpha-80: hsla(198deg 100% 46% 80%); --color-primary-alpha-80: hsla(198deg 100% 46% 80%);
--color-primary-alpha-90: hsla(198deg 100% 46% 90%); --color-primary-alpha-90: hsla(198deg 100% 46% 90%);
--color-secondary: #454a57; --color-secondary: hsl(213, 12%, 30.6%);
--color-secondary-dark-1: #505665; --color-secondary-bg: hsl(213, 16%, 20%);
--color-secondary-dark-2: #5b6273; --color-secondary-dark-1: hsl(213, 12%, 35.5%);
--color-secondary-dark-3: #71798e; --color-secondary-dark-2: hsl(213, 12%, 40%);
--color-secondary-dark-4: #7f8699; --color-secondary-dark-3: hsl(213, 12%, 50%);
--color-secondary-dark-5: #8c93a4; --color-secondary-dark-4: hsl(213, 12%, 54.9%);
--color-secondary-dark-6: #9aa0af; --color-secondary-dark-5: hsl(213, 12%, 59.6%);
--color-secondary-dark-7: #a8adba; --color-secondary-dark-6: hsl(213, 12%, 64.5%);
--color-secondary-dark-8: #b6bac5; --color-secondary-dark-7: hsl(213, 12%, 69.4%);
--color-secondary-dark-9: #c4c7d0; --color-secondary-dark-8: hsl(213, 12%, 74.3%);
--color-secondary-dark-10: #d2d4db; --color-secondary-dark-9: hsl(213, 11%, 79.2%);
--color-secondary-dark-11: #dfe1e6; --color-secondary-dark-10: hsl(213, 11%, 84.1%);
--color-secondary-dark-12: #edeef1; --color-secondary-dark-11: hsl(213, 12.3%, 89%);
--color-secondary-dark-13: #fbfbfc; --color-secondary-dark-12: hsl(213, 12.5%, 93.7%);
--color-secondary-light-1: #373b46; --color-secondary-dark-13: hsl(213, 14.3%, 98.6%);
--color-secondary-light-2: #292c34; --color-secondary-light-1: hsl(213, 12%, 24.5%);
--color-secondary-light-3: #1c1e23; --color-secondary-light-2: hsl(213, 11.8%, 18.2%);
--color-secondary-light-4: #0e0f11; --color-secondary-light-3: hsl(213, 11%, 12.4%);
--color-secondary-alpha-10: #454a5719; --color-secondary-light-4: hsl(213, 9.7%, 6.1%);
--color-secondary-alpha-20: #454a5733; --color-secondary-alpha-10: hsla(213, 12%, 30.6%, 0.1);
--color-secondary-alpha-30: #454a574b; --color-secondary-alpha-20: hsla(213, 12%, 30.6%, 0.2);
--color-secondary-alpha-40: #454a5766; --color-secondary-alpha-30: hsla(213, 12%, 30.6%, 0.3);
--color-secondary-alpha-50: #454a5780; --color-secondary-alpha-40: hsla(213, 12%, 30.6%, 0);
--color-secondary-alpha-60: #454a5799; --color-secondary-alpha-50: hsla(213, 12%, 30.6%, 0.5);
--color-secondary-alpha-70: #454a57b3; --color-secondary-alpha-60: hsla(213, 12%, 30.6%, 0.6);
--color-secondary-alpha-80: #454a57cc; --color-secondary-alpha-70: hsla(213, 12%, 30.6%, 0.7);
--color-secondary-alpha-90: #454a57e1; --color-secondary-alpha-80: hsla(213, 12%, 30.6%, 0.8);
--color-secondary-alpha-90: hsla(213, 12%, 30.6%, 0.9);
/* Colors for buttons, labels, etc. */ /* Colors for buttons, labels, etc. */
--color-red: #cc4848; --color-red: hsl(0, 56.4%, 54.1%);
--color-red-light: #c23636; --color-red-light: hsl(0, 56.5%, 48.6%);
--color-orange: #cc580c; --color-orange: hsl(23.8, 88.9%, 42.4%);
--color-orange-light: #b84f0b; --color-orange-light: hsl(23.6, 88.7%, 38.2%);
--color-yellow: #cc9903; --color-yellow: hsl(44.8, 97.1%, 40.6%);
--color-yellow-light: #b88a03; --color-yellow-light: hsl(44.8, 96.8%, 37%);
--color-olive: #91a313; --color-olive: hsl(67.5, 79.1%, 36%);
--color-olive-light: #839311; --color-olive-light: hsl(67.4, 79.3%, 32%);
--color-green: hsl(124deg 41% 35%); --color-green: hsl(124deg 41% 35%);
--color-green-light: hsl(124deg 41% 45%); --color-green-light: hsl(124deg 41% 45%);
--color-teal: #00918a; --color-teal: hsl(177.1, 100%, 28.4%);
--color-teal-light: #00837c; --color-teal-light: hsl(176.8, 100%, 26%);
--color-blue: #3a8ac6; --color-blue: hsl(206, 56%, 50.2%);
--color-blue-light: #347cb3; --color-blue-light: hsl(206, 55%, 45.3%);
--color-violet: #906ae1; --color-violet: hsl(259.2, 66.5%, 64.9%);
--color-violet-light: #7b4edb; --color-violet-light: hsl(259.1, 66.2%, 58.2%);
--color-purple: #b259d0; --color-purple: hsl(284.9, 55.9%, 58.2%);
--color-purple-light: #a742c9; --color-purple-light: hsl(284.9, 55.6%, 52.4%);
--color-pink: #d22e8b; --color-pink: hsl(326, 64.6%, 50.2%);
--color-pink-light: #be297d; --color-pink-light: hsl(326.2, 64.5%, 45.3%);
--color-brown: #a47252; --color-brown: hsl(23.4, 33.3%, 48.2%);
--color-brown-light: #94674a; --color-brown-light: hsl(23.5, 33.3%, 43.5%);
--color-grey: #9ea2aa; --color-grey: hsl(220, 6.6%, 64.3%);
--color-grey-light: #8d919b; --color-grey-light: hsl(222.9, 6.5%, 58%);
--color-black: #1e222e; --color-black: hsl(213, 21.1%, 14.9%);
--color-black-light: #1b1f29; --color-black-light: hsl(222.9, 20.6%, 13.3%);
--color-gold: hsl(47.3, 50%, 46.3%);
/* other colors */ /* Color: diff */
--color-gold: #b1983b; --color-diff-removed-word-bg: hsl(0, 37%, 31.8%);
--color-white: #ffffff; --color-diff-added-word-bg: hsl(120, 25.5%, 31.6%);
--color-diff-removed-word-bg: #6f3333; --color-diff-removed-row-bg: hsl(0, 22.4%, 19%);
--color-diff-added-word-bg: #3c653c; --color-diff-moved-row-bg: hsl(59, 31%, 38.6%);
--color-diff-removed-row-bg: #3c2626; --color-diff-added-row-bg: hsl(133.6, 21.6%, 20%);
--color-diff-moved-row-bg: #818044; --color-diff-removed-row-border: hsl(0, 19%, 32.5%);
--color-diff-added-row-bg: #283e2d; --color-diff-moved-row-border: hsl(69.2, 46%, 61.4%);
--color-diff-removed-row-border: #634343; --color-diff-added-row-border: hsl(134.4, 20%, 24%);
--color-diff-moved-row-border: #bcca6f; --color-diff-inactive: hsl(229.4, 13.8%, 24%);
--color-diff-added-row-border: #314a37;
--color-diff-inactive: #353846;
--color-error-border: #a04141;
--color-error-bg: #522;
--color-error-bg-active: #744;
--color-error-bg-hover: #633;
--color-error-text: #f9cbcb;
--color-success-border: #458a57;
--color-success-bg: #284034;
--color-success-text: #6cc664;
--color-warning-border: #bb9d00;
--color-warning-bg: #3a3a30;
--color-warning-text: #fbbd08;
--color-info-border: #306090;
--color-info-bg: #26354c;
--color-info-text: #38a8e8;
--color-red-badge: #db2828;
--color-red-badge-bg: #db28281a;
--color-red-badge-hover-bg: #db28284d;
--color-green-badge: #21ba45;
--color-green-badge-bg: #21ba451a;
--color-green-badge-hover-bg: #21ba454d;
--color-yellow-badge: #fbbd08;
--color-yellow-badge-bg: #fbbd081a;
--color-yellow-badge-hover-bg: #fbbd084d;
--color-orange-badge: #f2711c;
--color-orange-badge-bg: #f2711c1a;
--color-orange-badge-hover-bg: #f2711c4d;
--color-git: #f05133;
/* target-based colors */
--color-body: #383c4a; /* Color: messages and status. */
--color-box-header: #404652; --color-error-border: hsl(0, 42%, 44.1%);
--color-box-header: hsl(227deg 16% 24%); --color-error-bg: hsl(0, 42.9%, 23%);
--color-error-bg-active: hsl(0, 27.3%, 37%);
--color-error-bg-hover: hsl(0, 33.3%, 30%);
--color-error-text: hsl(0, 79.3%, 88.6%);
--color-success-border: hsl(136, 33.3%, 40.6%);
--color-success-bg: hsl(150, 23%, 20%);
--color-success-text: hsl(116, 46%, 58.4%);
--color-warning-border: hsl(50, 100%, 37%);
--color-warning-bg: hsl(60, 9.4%, 20.8%);
--color-warning-text: hsl(44.7, 96.8%, 50.8%);
--color-info-border: hsl(210, 50%, 37.6%);
--color-info-bg: hsl(216.3, 33.3%, 22.4%);
--color-info-text: hsl(201.8, 79.3%, 56.5%);
--color-box-body: #2a2e3a; --color-body: hsl(213, 10%, 14%);
--color-box-body: hsl(227deg 16% 20%);
--color-box-body-highlight: #353945; --color-box-header: hsl(213, 12%, 22%);
--color-box-body-highlight: hsl(225deg 13% 24%); --color-box-body: hsl(213, 12%, 18%);
--color-text-dark: #dbe0ea; --color-box-body-highlight: hsl(213, 12%, 30%);
--color-text: #bbc0ca;
--color-text-light: #a6aab5; --color-text: hsl(220, 12.4%, 76.3%);
--color-text-light-1: #979ba6; --color-text-dark: hsl(220, 26%, 89%);
--color-text-light-2: #8a8e99; --color-text-light: hsl(224, 9.2%, 68%);
--color-text-light-3: #707687; --color-text-light-1: hsl(224, 7.8%, 62%);
--color-footer: #2e323e; --color-text-light-2: hsl(224, 6.8%, 57.1%);
--color-timeline: #4c525e; --color-text-light-3: hsl(224.3, 9.3%, 48.4%);
--color-input-text: #d5dbe6;
--color-input-background: #232933; /* "color-light" is actually a subtle black in dark themes, to darken an element.
--color-input-toggle-background: #454a57; * against different backgrounds. */
--color-input-border: #454a57; --color-light: hsla(0, 0%, 0%, 0.2);
--color-input-border-hover: #505667;
--color-navbar: #2a2e3a;
--color-navbar-transparent: #2a2e3a00;
--color-light: #00000028;
--color-light-mimic-enabled: rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled))); --color-light-mimic-enabled: rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled)));
--color-light-border: #ffffff28; --color-light-border: hsla(0, 0%, 100%, 0.2);
--color-hover: #ffffff10;
--color-hover: hsla(0deg, 0%, 100%, .1); --color-hover: hsla(213, 18%, 90%, .05);
--color-active: hsla(0deg, 0%, 100%, .15); --color-active: hsla(213, 18%, 90%, .1);
--color-menu: #2e323e; --color-shadow: hsla(0, 0%, 0%, 0);
--color-card: #2e323e;
--color-markup-table-row: #ffffff06; --color-menu: hsl(213, 15%, 21%);
--color-markup-code-block: #ffffff0d; --color-card: hsl(213, 15%, 21%);
--color-button: #353846;
--color-code-bg: #2a2e3a; --color-markup-table-row: hsla(0, 0%, 100%, 0);
--color-code-sidebar-bg: #2e323e; --color-markup-code-block: hsla(0, 0%, 100%, 0.1);
--color-shadow: #00000060;
--color-secondary-bg: #2a2e3a; --color-code-bg: hsl(213, 16%, 20%);
--color-text-focus: #fff; --color-code-sidebar-bg: hsl(213, 14.8%, 21%);
--color-expand-button: #3c404d;
--color-placeholder-text: #6a737d; --color-timeline: hsl(220, 10.6%, 33.3%);
/* Navbar. */
--color-navbar: hsl(213, 10%, 18%);
--color-navbar-transparent: hsla(213, 10%, 14%, 0);
--color-header-bar: hsl(213, 10%, 18%);
/* Buttons. */
--color-button: hsl(213, 14%, 24%);
--color-expand-button: hsl(213.9, 12.4%, 26.9%);
--color-button-basic-border: hsl(213, 14%, 30%);
--color-button-basic-bg: hsl(213, 14%, 22%);
--color-button-basic-bg: var(--color-light);
--color-button-basic-text: var(--color-text);
/* Inputs. */
--color-input-text: hsl(219, 25%, 87%);
--color-input-background: hsl(213, 14%, 10%);
--color-input-toggle-background: hsl(213, 11.5%, 30.6%);
--color-input-border: hsl(213, 11.5%, 30.6%);
--color-input-border-hover: hsl(224, 13%, 36%);
--color-placeholder-text: hsl(213, 8.2%, 45.3%);
--color-editor-line-highlight: var(--color-primary-light-5); --color-editor-line-highlight: var(--color-primary-light-5);
--color-project-board-bg: var(--color-secondary-light-2); --color-project-board-bg: var(--color-secondary-light-2);
--color-caret: var(--color-text); --color-caret: var(--color-text);
/* should ideally be --color-text-dark, see #15651 */ --color-border: var(--color-secondary-alpha-50);
--color-reaction-bg: #ffffff12;
--color-reaction-bg: hsla(0, 0%, 100%, 0.1);
--color-reaction-active-bg: var(--color-primary-alpha-40); --color-reaction-active-bg: var(--color-primary-alpha-40);
--color-header-bar: #2e323e;
--color-label-active-bg: #4c525e;
--color-accent: var(--color-primary-light-1);
--color-small-accent: var(--color-primary-light-5); --color-small-accent: var(--color-primary-light-5);
--color-active-line: #534d1b; --color-active-line: hsl(53.6, 50.9%, 21.6%);
accent-color: var(--color-accent);
color-scheme: dark;
--transition-speed: 150ms;
--box-shadow-float: 0px 1px 4px 0px rgba(0,0,0,0.1), 0px 5px 10px -1px rgba(0,0,0,0.05);
--box-shadow-dropdown-menu: var(--box-shadow-float);
--border-radius-outer: .39rem;
--spacer: 1rem;
--spacer-1: .25rem;
--spacer-2: .5rem;
--spacer-3: var(--spacer);
--spacer-4: 1.5rem;
--spacer-5: 3rem;
/* Labels. e.g. issues count indicator in repo tabs. */ /* Labels. e.g. issues count indicator in repo tabs. */
--label-color-primary-bg: var(--color-secondary); --color-label-primary-bg: var(--color-secondary);
--color-label-active-bg: hsl(220, 10.6%, 33.3%);
/* Footer. */ /* Footer. */
--color-footer: hsl(213, 14.8%, 21%);
--color-footer-text: var(--color-text-light-3); --color-footer-text: var(--color-text-light-3);
--color-footer-links: var(--color-text-light-1); --color-footer-links: var(--color-text-light-1);
} }
/* Custom styling of individual elements. /* Custom styling of individual elements.
* Using !important is bad, but unfortunately gitea does it already in _base.less. */ * Using !important is bad, but unfortunately gitea does it already in _base.less. */
.ui.primary.label {
background-color: var(--label-color-primary-bg) !important; /* Buttons. */
.ui.basic.button {
color: var(--color-button-basic-text);
background: var(--color-button-basic-bg);
border-color: var(--color-button-basic-border);
} }
.ui.primary.button, .ui.primary.button,
@ -236,7 +244,7 @@
} }
/* Vertical menu. /* Vertical menu.
* Used in: /issues */ * Used in: /issues */
.ui.vertical.menu { .ui.vertical.menu {
padding: var(--spacer-1); padding: var(--spacer-1);
border-radius: var(--border-radius); border-radius: var(--border-radius);
@ -250,7 +258,7 @@
} }
/* Dropdown menus. /* Dropdown menus.
* e.g. */ * e.g. user menu. */
.ui.dropdown .menu { .ui.dropdown .menu {
border-radius: var(--border-radius) !important; border-radius: var(--border-radius) !important;
box-shadow: var(--box-shadow-dropdown-menu) !important; box-shadow: var(--box-shadow-dropdown-menu) !important;
@ -269,6 +277,10 @@
border-radius: 0 var(--border-radius) var(--border-radius) 0; border-radius: 0 var(--border-radius) var(--border-radius) 0;
} }
.ui.menu.new-menu {
border-color: var(--color-secondary-alpha-50) !important;
}
/* Navigation tabs. /* Navigation tabs.
* e.g. Code, Issues pages in a repository. */ * e.g. Code, Issues pages in a repository. */
.ui.tabular.menu .item { .ui.tabular.menu .item {
@ -294,13 +306,46 @@
color: var(--color-primary-contrast); color: var(--color-primary-contrast);
} }
/* Labels. e.g. issues count indicator in repo tabs. */
.ui.tabular.navbar .ui.small.label {
background-color: var(--color-label-primary-bg) !important;
border-radius: 999em;
}
/* Top navigation bar. /* Top navigation bar.
* e.g. Issues, Pull Requests, etc. */ * e.g. Issues, Pull Requests, etc. */
.ui.menu.bar { .ui.menu.bar {
border: none; border: none;
} }
/* Navbar logo. */
.item.brand a {
opacity: .8;
transition: opacity var(--transition-speed) ease-in-out;
}
.item.brand a:hover {
opacity: 1;
}
.item.brand svg {
height: 21px;
}
.ui.breadcrumb a {
color: var(--color-text);
}
/* Repository page. */ /* Repository page. */
.repository .repo-header a,
.repository .repo-title a {
color: var(--color-text);
}
.repository .ui.table a {
color: var(--color-text);
}
.repository .ui.tabs.divider { .repository .ui.tabs.divider {
border: none; border: none;
} }
@ -310,6 +355,19 @@
color: currentColor; color: currentColor;
} }
.ui.repo-topic.label {
border-radius: 999em;
}
/* Repository stats. */
.repository-summary-language-stats {
height: unset;
}
.repository .repository-summary .segment.language-stats {
height: 4px;
}
/* Repository: Activity page. */ /* Repository: Activity page. */
.stats-table { .stats-table {
border-radius: 999em; border-radius: 999em;
@ -317,6 +375,15 @@
overflow: hidden; overflow: hidden;
} }
.issue.list>.item+.item {
border-color: var(--color-border);
}
/* Divider. */
.ui.divider:not(.vertical, .horizontal) {
border-top-color: var(--color-border);
}
/* Footer. */ /* Footer. */
footer { footer {
color: var(--color-footer-text); color: var(--color-footer-text);
@ -326,6 +393,11 @@ footer a {
color: var(--color-footer-links); color: var(--color-footer-links);
} }
/* Homepage. */
.home a {
color: var(--color-accent);
}
/* (from arc-green) /* (from arc-green)
* invert emojis that are hard to read otherwise */ * invert emojis that are hard to read otherwise */
.emoji[aria-label="check mark"], .emoji[aria-label="check mark"],