There’s nothing special about CSS in CKAN, once you’ve got started with
editing CSS in CKAN (by following the tutorial below), then you just use the
usual tools and techniques to explore and hack the CSS. We recommend using
your browser’s web development tools to explore and experiment with the CSS,
then using any good text editor to edit your extension’s CSS files as
needed. For example:

To make CKAN use our custom CSS we need to override the base.html template,
this is the base template which the templates for all CKAN pages extend, so if
we include a CSS file in this base template then the file will be included in
every page of your CKAN site. Create the file:

The default base.html template defines a styles block which can be
extended to link to custom CSS files (any code in the styles block will appear
in the <head> of the HTML page).

Restart the development web server and reload the CKAN page in your browser,
and you should see the background color of the account masthead change:

This custom color should appear on all pages of your CKAN site.

Now that we have CKAN using our CSS file, we can add more CSS rules to the file
and customize CKAN’s CSS as much as we want.
Let’s add a bit more code to our example_theme.css file. This CSS
implements a partial imitation of the datahub.io theme
(circa 2013):

/* ===================================================== The "account masthead" bar across the top of the site ===================================================== */.account-masthead{background-color:rgb(40,40,40);}/* The "bubble" containing the number of new notifications. */.account-masthead.account.notificationsaspan{background-color:black;}/* The text and icons in the user account info. */.account-masthead.accountullia{color:rgba(255,255,255,0.6);}/* The user account info text and icons, when the user's pointer is hovering over them. */.account-masthead.accountullia:hover{color:rgba(255,255,255,0.7);background-color:black;}/* ======================================================================== The main masthead bar that contains the site logo, nav links, and search ======================================================================== */.masthead{background-color:#3d3d3d;}/* The "navigation pills" in the masthead (the links to Datasets, Organizations, etc) when the user's pointer hovers over them. */.masthead.navigation.nav-pillslia:hover{background-color:rgb(48,48,48);color:white;}/* The "active" navigation pill (for example, when you're on the /dataset page the "Datasets" link is active). */.masthead.navigation.nav-pillsli.activea{background-color:rgb(74,74,74);}/* The "box shadow" effect that appears around the search box when it has the keyboard cursor's focus. */.mastheadinput[type="text"]:focus{-webkit-box-shadow:inset0px0px2px0pxrgba(0,0,0,0.7);box-shadow:inset0px0px2px0pxrgba(0,0,0,0.7);}/* =========================================== The content in the middle of the front page =========================================== *//* Remove the "box shadow" effect around various boxes on the page. */.box{box-shadow:none;}/* Remove the borders around the "Welcome to CKAN" and "Search Your Data" boxes. */.hero.box{border:none;}/* Change the colors of the "Search Your Data" box. */.homepage.module-search.module-content{color:rgb(68,68,68);background-color:white;}/* Change the background color of the "Popular Tags" box. */.homepage.module-search.tags{background-color:rgb(61,61,61);}/* Remove some padding. This makes the bottom edges of the "Welcome to CKAN" and "Search Your Data" boxes line up. */.module-content:last-child{padding-bottom:0px;}.homepage.module-search{padding:0px;}/* Add a border line between the top and bottom halves of the front page. */.homepage[role="main"]{border-top:1pxsolidrgb(204,204,204);}/* ==================================== The footer at the bottom of the site ==================================== */.site-footer,body{background-color:rgb(40,40,40);}/* The text in the footer. */.site-footer,.site-footerlabel,.site-footersmall{color:rgba(255,255,255,0.6);}/* The link texts in the footer. */.site-footera{color:rgba(255,255,255,0.6);}