139 lines
3.4 KiB
Groovy
Raw Normal View History

2026-01-13 09:59:39 -03:00
import jenkins.model.Jenkins
import org.codefirst.SimpleThemeDecorator
2026-01-20 18:13:49 -03:00
import org.jenkinsci.plugins.simpletheme.CssTextThemeElement
2026-01-13 09:59:39 -03:00
def instance = Jenkins.get()
def decorators = instance.getExtensionList(SimpleThemeDecorator.class)
if (decorators?.size() > 0) {
def theme = decorators[0]
2026-01-20 18:13:49 -03:00
def cssRules = """
:root,
.app-theme-picker__picker[data-theme=none] {
--background: #0f1216 !important;
--header-background: #141922 !important;
--header-border: #2b313b !important;
--white: #141922 !important;
--black: #e6e9ef !important;
--very-light-grey: #171b21 !important;
--light-grey: #202734 !important;
--medium-grey: #2b313b !important;
--dark-grey: #0b0f14 !important;
--text-color: #e6e9ef !important;
--text-color-secondary: #a6adba !important;
--card-background: #171b21 !important;
--card-border-color: #2b313b !important;
--pane-header-bg: #1f252d !important;
--pane-header-border-color: #2b313b !important;
--pane-border-color: #2b313b !important;
--pane-text-color: #e6e9ef !important;
--pane-header-text-color: #e6e9ef !important;
--link-color: #8fb7ff !important;
--link-color--hover: #b0ccff !important;
--link-dark-color: #e6e9ef !important;
--link-dark-color--hover: #b0ccff !important;
--input-color: #151a20 !important;
--input-border: #2b313b !important;
--input-border-hover: #3a424d !important;
--button-background: #232a33 !important;
--button-background--hover: #2b313b !important;
--button-background--active: #323b46 !important;
--item-background--hover: #232a33 !important;
--item-background--active: #2b313b !important;
--accent-color: #8fb7ff !important;
2026-01-20 18:00:36 -03:00
}
body,
#page-body,
#page-header,
#header,
#main-panel,
#main-panel-content,
#side-panel,
.top-sticker-inner,
.bottom-sticker-inner,
#breadcrumbBar,
#breadcrumbs {
2026-01-20 18:13:49 -03:00
background-color: var(--background) !important;
color: var(--text-color) !important;
2026-01-20 18:00:36 -03:00
}
2026-01-20 18:13:49 -03:00
.jenkins-card,
.jenkins-section,
.jenkins-section__item,
#main-panel .jenkins-card,
#main-panel .jenkins-section {
background-color: var(--card-background) !important;
color: var(--text-color) !important;
border-color: var(--card-border-color) !important;
2026-01-20 18:00:36 -03:00
}
2026-01-20 18:13:49 -03:00
table.pane,
table.pane td,
table.pane th,
#projectstatus td,
#projectstatus th {
background-color: var(--card-background) !important;
color: var(--text-color) !important;
2026-01-20 18:00:36 -03:00
}
table.pane tr:nth-child(even) td,
#projectstatus tr:hover td {
2026-01-20 18:13:49 -03:00
background-color: #1f252d !important;
2026-01-20 18:00:36 -03:00
}
input,
select,
textarea,
#search-box {
2026-01-20 18:13:49 -03:00
background-color: #151a20 !important;
color: var(--text-color) !important;
border-color: var(--input-border) !important;
2026-01-20 18:00:36 -03:00
}
2026-01-20 18:13:49 -03:00
a,
a:visited,
a:link {
color: var(--link-color) !important;
2026-01-20 18:00:36 -03:00
}
2026-01-20 18:13:49 -03:00
a:hover {
opacity: 0.85;
2026-01-20 18:00:36 -03:00
}
#side-panel .task-link,
2026-01-20 18:13:49 -03:00
#breadcrumbs a,
#breadcrumbs,
#projectstatus th a {
color: var(--text-color-secondary) !important;
}
.console-output,
.console-output pre,
pre,
code,
.CodeMirror {
background-color: #0c0f14 !important;
color: #d9dee7 !important;
2026-01-20 18:00:36 -03:00
}
#footer {
2026-01-20 18:13:49 -03:00
background-color: var(--background) !important;
color: var(--text-color-secondary) !important;
2026-01-20 18:00:36 -03:00
}
.jenkins_ver:after {
content: "atlas dark";
}
2026-01-20 18:13:49 -03:00
""".stripIndent().trim()
theme.setElements([new CssTextThemeElement(cssRules)])
theme.setCssUrl("")
theme.setCssRules(cssRules)
2026-01-13 09:59:39 -03:00
theme.setJsUrl("")
2026-01-20 18:13:49 -03:00
theme.save()
2026-01-13 09:59:39 -03:00
println("Applied simple-theme-plugin dark theme")
} else {
println("simple-theme-plugin not installed; skipping theme configuration")
}