From 6db7521114e167185775927fb72e5fe80ed37106 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 20 Jan 2026 17:43:23 -0300 Subject: [PATCH] jenkins: add local dark theme css --- services/jenkins/deployment.yaml | 4 + services/jenkins/kustomization.yaml | 1 + services/jenkins/scripts/jenkins-theme.css | 97 ++++++++++++++++++++++ services/jenkins/scripts/theme.groovy | 2 +- 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 services/jenkins/scripts/jenkins-theme.css diff --git a/services/jenkins/deployment.yaml b/services/jenkins/deployment.yaml index 9f8fe99..b69f134 100644 --- a/services/jenkins/deployment.yaml +++ b/services/jenkins/deployment.yaml @@ -94,6 +94,7 @@ spec: - -c - | set -e + mkdir -p /var/jenkins_home/userContent exec env $(cat /vault/secrets/jenkins-env) /usr/bin/tini -- /usr/local/bin/jenkins.sh ports: - name: http @@ -152,6 +153,9 @@ spec: mountPath: /config/jcasc - name: init-scripts mountPath: /usr/share/jenkins/ref/init.groovy.d + - name: init-scripts + mountPath: /var/jenkins_home/userContent/jenkins-theme.css + subPath: jenkins-theme.css - name: plugin-dir mountPath: /usr/share/jenkins/ref/plugins - name: tmp diff --git a/services/jenkins/kustomization.yaml b/services/jenkins/kustomization.yaml index aab859a..444dd6d 100644 --- a/services/jenkins/kustomization.yaml +++ b/services/jenkins/kustomization.yaml @@ -18,6 +18,7 @@ configMapGenerator: - name: jenkins-init-scripts namespace: jenkins files: + - jenkins-theme.css=scripts/jenkins-theme.css - git-notify-token.groovy=scripts/git-notify-token.groovy - theme.groovy=scripts/theme.groovy options: diff --git a/services/jenkins/scripts/jenkins-theme.css b/services/jenkins/scripts/jenkins-theme.css new file mode 100644 index 0000000..56fe193 --- /dev/null +++ b/services/jenkins/scripts/jenkins-theme.css @@ -0,0 +1,97 @@ +@import url("https://cdn.jsdelivr.net/gh/Jorg3Lucas/jenkins-modern-themes@main/dist/modern-blue-grey.css"); + +:root { + --atlas-bg: #0f1216; + --atlas-surface: #171b21; + --atlas-surface-alt: #1f252d; + --atlas-border: #2b313b; + --atlas-text: #e6e9ef; + --atlas-text-muted: #b3bac6; + --atlas-link: #8fb7ff; +} + +body, +#page-body, +#page-header, +#header, +#main-panel, +#main-panel-content, +#side-panel, +.top-sticker-inner, +.bottom-sticker-inner, +#breadcrumbBar, +#breadcrumbs { + background-color: var(--atlas-bg) !important; + color: var(--atlas-text) !important; +} + +#side-panel .task-link, +#breadcrumbs a, +#breadcrumbs, +#projectstatus th a, +#projectstatus td, +#projectstatus th { + color: var(--atlas-text-muted) !important; +} + +a, +a:visited, +a:link { + color: var(--atlas-link) !important; +} + +a:hover { + opacity: 0.85; +} + +#main-panel, +#main-panel-content, +#description, +.pane, +table.pane { + background-color: var(--atlas-surface) !important; + color: var(--atlas-text) !important; +} + +table.pane tr:nth-child(odd) td { + background-color: var(--atlas-surface) !important; +} + +table.pane tr:nth-child(even) td, +#projectstatus tr:hover td { + background-color: var(--atlas-surface-alt) !important; +} + +input, +select, +textarea, +#search-box { + background-color: var(--atlas-surface-alt) !important; + color: var(--atlas-text) !important; + border-color: var(--atlas-border) !important; +} + +#header, +#page-header { + background-color: #202734 !important; +} + +#header .login, +#page-header .login { + color: var(--atlas-text) !important; +} + +#side-panel .task-link, +#side-panel .task-link:visited, +#side-panel .task-link:hover { + color: var(--atlas-text) !important; +} + +#footer { + background-color: var(--atlas-bg) !important; + color: var(--atlas-text-muted) !important; +} + +.jenkins_ver:after { + content: "atlas dark"; +} diff --git a/services/jenkins/scripts/theme.groovy b/services/jenkins/scripts/theme.groovy index 5950bf4..fd12474 100644 --- a/services/jenkins/scripts/theme.groovy +++ b/services/jenkins/scripts/theme.groovy @@ -6,7 +6,7 @@ def decorators = instance.getExtensionList(SimpleThemeDecorator.class) if (decorators?.size() > 0) { def theme = decorators[0] - theme.setCssUrl("https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-ocean.css") + theme.setCssUrl("https://ci.bstein.dev/userContent/jenkins-theme.css") theme.setJsUrl("") instance.save() println("Applied simple-theme-plugin dark theme")