From d75833e5e0e1983cb1c9efec28cf6746e547cab0 Mon Sep 17 00:00:00 2001
From: Jan Faracik <43062514+janfaracik@users.noreply.github.com>
Date: Wed, 3 Jan 2024 09:27:14 +0000
Subject: [PATCH] Update appearance of controls in header (#8791)
* Init
* Tidy up
* Update resources.css
* Update resources.css
* Tidy up
* Update resources.css
---
.../loginLink.jelly | 3 +-
.../security/SecurityRealm/loginLink.jelly | 2 +-
.../resources.css | 75 +++++--------------
.../main/scss/components/_page-header.scss | 40 +++-------
4 files changed, 34 insertions(+), 86 deletions(-)
diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/loginLink.jelly b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/loginLink.jelly
index ba75e740a89e..cd989c23f030 100644
--- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/loginLink.jelly
+++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/loginLink.jelly
@@ -26,7 +26,6 @@ THE SOFTWARE.
- |
- ${%sign up}
+ ${%sign up}
diff --git a/core/src/main/resources/hudson/security/SecurityRealm/loginLink.jelly b/core/src/main/resources/hudson/security/SecurityRealm/loginLink.jelly
index 8b065c318b2c..8fb92ed3dd1c 100644
--- a/core/src/main/resources/hudson/security/SecurityRealm/loginLink.jelly
+++ b/core/src/main/resources/hudson/security/SecurityRealm/loginLink.jelly
@@ -25,5 +25,5 @@ THE SOFTWARE.
- ${%login}
+ ${%login}
diff --git a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/resources.css b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/resources.css
index 5960ecd93193..d5d817c6a223 100644
--- a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/resources.css
+++ b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/resources.css
@@ -1,5 +1,5 @@
.am-container {
- height: 100%;
+ display: contents;
}
.am-button {
@@ -14,89 +14,62 @@
border-radius: 50%;
width: 0.65rem;
height: 0.65rem;
- background-color: #ff9800;
+ background-color: var(--warning-color);
}
.security-am .am-monitor__indicator-mobile {
- background-color: #dc3545;
+ background-color: var(--error-color);
}
.am-button .am-monitor__count {
- display: inline-block;
display: inline-flex;
justify-content: center;
align-items: center;
- height: 20px;
- min-width: 20px;
+ height: 18px;
+ min-width: 18px;
color: #fff;
- background-color: #ff9800;
- font-weight: bold;
+ background-color: var(--warning-color);
+ font-weight: 500;
+ font-size: var(--font-size-xs);
- border-radius: 4px;
+ border-radius: 16px;
}
.am-button.security-am .am-monitor__count {
color: #fff;
- background-color: #dc3545;
+ background-color: var(--error-color);
}
.am-container div.am-list {
position: absolute;
top: 48px;
right: 2%;
height: auto;
- z-index: 0;
- padding: 2em;
+ padding: var(--section-padding);
text-align: left;
display: block;
- background-color: #fff;
background-color: var(--background);
- border-radius: 5px;
-
- /* Darken the box shadow to make the popup visible over the search box */
- box-shadow: 0 1px 7px 0 rgba(0, 0, 0, 0.3);
-
- transition: all 0.15s cubic-bezier(0.84, 0.03, 0.21, 0.96);
+ box-shadow: var(--dropdown-box-shadow);
+ transition: var(--standard-transition);
+ border-radius: 15px;
opacity: 0;
- transform: scale(0);
+ transform: translateY(-10px) scale(0.975);
+ z-index: 1000;
}
.am-container.visible div.am-list {
opacity: 1;
transform: scale(1);
- z-index: 1000;
-}
-.am-container.visible .am-button {
- background-color: #404040;
- background-color: var(--header-link-bg-classic-active);
- text-decoration: none;
-}
-.am-container .am-button:after {
- content: "";
- display: inline-block;
- position: absolute;
- bottom: 0;
- left: 32%;
- width: 0;
- height: 0;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #fff;
- opacity: 0;
- transition-property: all;
- transition-delay: 0s;
- z-index: 1001;
-}
-.am-container.visible .am-button:after {
- opacity: 1;
- transition-property: all;
- transition-delay: 0.15s;
}
.am-container .am-message {
display: block;
line-height: 1.4em;
margin-bottom: 1.4em;
}
+.am-container.visible .am-button:after {
+ background: var(--button-background--hover);
+}
.am-message-list {
padding: 0;
+ margin: 0;
}
.am-container .am-message .alert form {
@@ -123,22 +96,18 @@
/* Restore hyperlink style overriden by the page header */
.am-container .am-list a:link {
display: inline-block;
- color: #204a87;
color: var(--link-color);
text-decoration: underline;
margin-right: 0;
padding: 0;
- font-weight: 600;
font-weight: var(--link-font-weight);
}
.am-container .am-list a:visited {
- color: #5c3566;
color: var(--link-color);
}
.am-container .am-list a:hover,
.am-container .am-list a:focus,
.am-container .am-list a:active {
- color: #5c3566;
color: var(--link-color);
background-color: transparent;
text-decoration: underline;
@@ -146,22 +115,18 @@
}
.am-container .am-list .alert-success a {
- color: #155724;
color: var(--alert-success-text-color);
}
.am-container .am-list .alert-info a {
- color: #31708f;
color: var(--alert-info-text-color);
}
.am-container .am-list .alert-warning a {
- color: #8a6d3b;
color: var(--alert-warning-text-color);
}
.am-container .am-list .alert-danger a {
- color: #a94442;
color: var(--alert-danger-text-color);
}
diff --git a/war/src/main/scss/components/_page-header.scss b/war/src/main/scss/components/_page-header.scss
index 13e63d91a771..e1b34ea09c71 100644
--- a/war/src/main/scss/components/_page-header.scss
+++ b/war/src/main/scss/components/_page-header.scss
@@ -1,3 +1,5 @@
+@use "../abstracts/mixins";
+
.page-header {
display: flex;
align-items: center;
@@ -36,8 +38,7 @@ a.page-header__brand-link {
}
.page-header__am-wrapper {
- height: 100%;
- padding: 0.5rem 0;
+ display: contents;
}
.page-header__hyperlinks {
@@ -45,37 +46,22 @@ a.page-header__brand-link {
align-items: center;
}
-.page-header__hyperlinks a {
+.page-header__hyperlinks > a,
+.am-container > a {
+ @include mixins.item;
+
--text-color: var(--header-link-color);
display: inline-flex;
align-items: center;
-
- // need to override an existing rule
- /* stylelint-disable declaration-block-no-shorthand-property-overrides */
- padding-right: 0.5rem;
+ color: var(--text-color);
+ text-decoration: none;
padding: 0.5rem;
margin-right: 0 !important;
- font-weight: bold;
-
- &:link,
- &:visited {
- color: var(--header-link-color);
- border-radius: var(--header-item-border-radius);
- text-decoration: none;
- }
- &:hover,
- &:focus,
- &.mouseIsOverMenuSelector {
- color: var(--header-link-color-active);
- background-color: var(--header-link-bg-classic-hover);
- text-decoration: underline;
- text-decoration-color: var(--header-link-color-active);
- }
-
- &:active {
- background-color: var(--header-link-bg-classic-active);
+ &::before,
+ &::after {
+ inset: 0 !important;
}
.jenkins-menu-dropdown-chevron {
@@ -91,8 +77,6 @@ a.page-header__brand-link {
}
.page-header__hyperlinks a span {
- font-weight: bold;
-
&:not(:first-child) {
margin-left: 0.25rem;
}