How do I customize Jenkins theme? - jenkins

I want to change background images, logo ,headings and add some buttons.
I have the following UI related plugins installed
1) Simple Theme Plugin
A plugin for Jenkins that supports custom CSS & JavaScript. You can customize Jenkins's appearance (ex. his gentle face on the background).
version 0.3
2) UI Themes: Plugin
This plugin provides UI themes for Jenkins.
version 2.1.1
I have found some answer regarding the same but didn't find much help.
-->> Customising Jenkins' appearance to make it easier to tell instances apart
-->> http://isotope11.com/blog/styling-your-jenkins-continuous-integration-server
Please give steps or any links from which I can completely change the appearance of my Jenkins server.

If you are comfortable with CSS styling, you could create a theme, by making a CSS styling file and uploading it to a directly-serving server (Even the one your using for jenkins, in a new folder) or JavaScript styling (same diddy) could be added to the option at your jenkins {host}/configure under "Theme". However, in my experience the 1.609.1 version of jenkins does NOT support this plugin properly in OpenShift Cloud hosting.

You can see an example of full theme in progress in jenkinsci/dark-theme.
It is not yet ready, but can illustrate how the CSS is setup with a Jenkins 2.220+ (May 2020)

If you are comfortable in CSS, you can easily customize logo and titel in theme with .css file.
For example, I have added JENKINS_HOME/usercontent/mytheme.css file JENKINS_HOME/usercontent/logo.png as my logo and follow the css below:
#charset “utf-8”;
#header .logo {
height: 36px;
}
/* Custom style for my Jenkins Platform */
.logo {
background: url(/userContent/logo.png) no-repeat 10px center;
}
.logo img {
display: none;
}
.logo:after {
content: 'Jenkins my instance';
font-weight: bold;
white-space: nowrap;
} // Content after logo
Just check in Configure System --> Theme you must give CSS path of above mytheme.css file. & Refresh your Jenkins Page.
See the reference LINK here !

Related

How to change default logo for Jenkins

I need to add a custom logo to my Jenkins page which should appear on login page and post login pages as well.
As others pointed out, install the Login Page Theme plugin
Go to Manage Jenkins -> Configure System -> Login Page Theme
To change the logo, simply add the following style element in the Head section
<style>
.simple-page .logo {
background-image: url('https://www.jenkins.io/images/logos/snow/snow.png');
background-repeat: no-repeat;
background-position: 50% 0;
height: 350px;
background-size: contain;
}
.simple-page form {
width: unset;
max-width: unset;
}
<style>
To change the header text shown below the logo, add the following script element in the Header section
<script>
document.getElementsByTagName('h1')[0].textContent = 'Welcome to Balajee\'s Jenkins!'
</script>
Finally hit save and apply.
When you login next time, you should see something like this
As plugin page clearly says..
Only install this plugin, or make it available for installation, if you trust all your Jenkins administrators not to abuse these options.
I think you need to read this post on the Jenkins blog (assuming Jenkins >= 2.128):
New design, UX and extensibility digest for login page et. al.
Overview
... New design for the login and signup forms and Jenkins is (re)starting pages introduced in Jenkins 2.128 ... This meant to drop the usage of the jelly layout lib (aka xmlns:l="/lib/layout") and as well the page decorators it supported. However there is a new SimplePageDecorator extension point.
SimplePageDecorator - custom implementations
Have a look at Login Theme Plugin, which allows you to configure your own custom content to be injected into the new login/sign-up page.
The Simple Theme plugin can be used to customize the rest of the pages.

Cannot change mat-spinner's colour

I know this question has been asked (Change color of mat-spinner) but I was wondering if there's been a solution to not using the deprecated ::ng-deep?
In addition, I've also tried the method suggested in the link but that doesn't work:
HTML
<mat-progress-spinner *ngIf="pending" mode="indeterminate" class="mat-spinner-color"></mat-progress-spinner>
SCSS
.mat-spinner-color::ng-deep circle{
stroke: #FFFFFF !important;
}
Thanks in advance!
::ng-deep is not officially deprecated and is contingent upon browsers removing support for it, per angular.io, until then, meaning is officially deprecated by the browsers, it should be preferred over /deep/ and >>> for broader compatibility.
As such we plan to drop support in Angular (for all 3 of /deep/, >>>
and ::ng-deep). Until then ::ng-deep should be preferred for a broader
compatibility with the tools.
https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep
If your preference is to avoid ::ng-deep you will need to apply your modifications for the mat-spinner to the root styles.css in your project
in styles.css
.orange-spinner circle{
stroke:orange !important;
}
add class
<mat-spinner class="orange-spinner"></mat-spinner>
Stackblitz
https://stackblitz.com/edit/angular-czd4zq?embed=1&file=styles.css
Please note:
Per UmutEsen comment below, the correct solution is to setup a theme and leverage the color input on the mat-spinner.
https://material.angular.io/guide/theming

Grails resources not working with cache-busting CKEditor release (4.5.5+)

I am unable to get a Grails 2.5.2 application using the resources plugin to handle the cache-busting change made to CKEditor. The resources plugin is configured as follows:
grails.resources.adhoc.patterns = ['/js/*', '/images/*', '/css/*', '/plugins/*', '/thirdparty/*', '/templates/*']
grails.resources.adhoc.includes = ['/js/**', '/images/**', '/css/**', '/plugins/**', '/thirdparty/**', '/templates/**']
The CKEditor code is placed under app-dir/web-app/thirdparty/ckeditor and is currently at version 4.5.9. The cache-busting change was made in 4.5.5, and version 4.5.4 works perfectly with grails resources.
I get the following error in the console when running the app with 4.5.9:
GET resource:/thirdparty/ckeditor/skins/moono/icons.png?t=a35abfe net::ERR_UNKNOWN_URL_SCHEME
It seems that the resources plugin is not coping well with values in ckeditor's editor.css file (a file served by the app points to app-dir/thirdparty/ckeditor/skins/moono/editor.css?t=G4CD as http://localhost:8080/app-dir/static/thirdparty/ckeditor/skins/moono/editor.css?t=G4CD). If I look at this file directly, it contains the following for the icons.png and icons_hidpi.png files, indicating that the resources plugin is incorrectly replacing the image file link (all but the first, actually) with a "resource:/..." url that shouldn't need to be there, and hence the console error. Curiously, it is only the icons.png and icons_hidpi.png files with their t parameter that get changed in this manner, other image files in the same editor.css file are left alone.
.cke_button__bold_icon {background: url(icons.png?t=a35abfe) no-repeat 0 -0px !important;}
.cke_button__italic_icon {background: url(resource:/thirdparty/ckeditor/skins/moono/icons.png?t=a35abfe) no-repeat 0 -24px !important;}
.cke_button__strike_icon {background: url(resource:/thirdparty/ckeditor/skins/moono/icons.png?t=a35abfe) no-repeat 0 -48px !important;}
.cke_button__subscript_icon {background: url(resource:/thirdparty/ckeditor/skins/moono/icons.png?t=a35abfe) no-repeat 0 -72px !important;}
If I add the following configuration, the app runs and displays perfectly.
grails.resources.processing.enabled = false
If I use
grails.resources.mappers.cssrewriter.excludes = ['/thirdparty/ckeditor/skins/moono/**']
in an attempt to prevent resources from modifying ckeditor's editor.css file, nothing seems to change.
What can I do? I can't leave ckeditor at 4.5.4, as there is an interaction with it that I'm trying to fix. I'm already using the same configuration as recommended in another post, but that does not fix the problem. Disabling css rewriting altogether just breaks other plugins.
The eventual solution (recommended by a colleague) is to exclude the specific CSS file(s) from being processed by grails resources:
resource url:"thirdparty/ckeditor/skins/moono/editor.css", exclude: "*"
This avoids affecting other files that were either unaffected by the upgraded CKEditor, or benefited from the processing done by grails resources.

LESS generated CSS not being applied - stumped! (VS 2013 LESS bundling)

I'm completely stumped - what am I missing?
I have a LESS file called Main.less - and VS 2013 automatically generates Main.min.css whenever I save it.
The CSS generated is fine - no errors. When I copy the generated CSS to my Style.css (to verify) it is applied correctly.
I bundle the Main.min.css generated from the LESS file via the usual bundleconfig along with other css files (mainly my bootstrap and site css).
When I run the site, I can see the styles in the referenced bundled source - but the style is not applied! What am I missing?
(here is the .LESS)
#color1: #FFA114;
#color2: #69b1fa;
#std_border: 2px;
.rounded {
border-radius: 10px;
}
.sel_1 {
.rounded;
border: #std_border solid #color1;
}
(here is the .css as it appears in the minified bundle on the browser)
.rounded{border-radius:10px}.sel_1{border-radius:10px;border:2px solid #ffa114}
I can only imagine something is wrong somewhere so that the browsers (latest Chrome and IE) don't even apply the styles. No idea what...
EDIT: UPDATE:
I also referred the generated min.css directly
<link href="/Content/Main.min.css" rel="stylesheet" />
and on browser-> view source -> click on the .css you see the following
.rounded{border-radius:10px}.sel_1{border-radius:10px;border:2px solid #ffa114}.sel_2{border-radius:10px;border:2px solid #ffa114;border-color:#69b1fa}.asel_1{border-radius:10px;border:2px solid #ffa114;border-style:dashed}.asel_2{border-radius:10px;border:2px solid #ffa114;border-color:#69b1fa;border-style:dashed}.map_sel{border:3px double #69b1fa}.line{border-bottom:2px #ffa114 solid;padding:10px}
And the styles are still not applied!

Jenkins simple theme plugin examples or tutorial

I installed the Simple Theme plugin on my Jenkins instance, and I managed to do some (very) basic theme changes.
Does anyone have a better reference to the Jenkins theme?
The plugin page is very low on info...
If I want to override a style attribute, I have to dig into the generated html and do a lot of experimenting.
You can customize your known simple theme with .css file.
Make sure that you have .png logo image, I have added 'Jenkins_home/usercontent/mytheme.css' file 'Jenkins_home/usercontent/logo.png' as my logo.
and follow the css below:
#charset “utf-8”;
#header .logo {
height: 36px;
}
/* Custom style for my Jenkins Platform */
.logo {
background: url(/userContent/logo.png) no-repeat 10px center;
}
.logo img {
display: none;
}
.logo:after {
content: 'Jenkins my instance';
font-weight: bold;
white-space: nowrap;
} // Content after logo
Just check in Jenkins Configuration theme must be CSS URL and you must add path of above 'mytheme.css' file.
& Refresh your Jenkins Page.
Found a simple tutorial here for start:
http://www.techgaun.com/2013/06/customizing-jenkins-layout.html
Open Jenkins in Chrome or FireFox and press F12.
Right click on the UI element you want to change and select Inspect Element.
In the debug window the line in the html is highlighted.
Record the id and/or class of the UI element.
Open style.css and search for the id/class.
Copy the css-code and paste it in .css which you save in the css directory.
In the Theme section on the Configuration page enter css/.css as URL of theme CSS.
Now start altering .css to get the looks you desire.
Enable auto refesh to see the changes, Ctrl-F5 also helps

Resources