All Apps and Add-ons

Why is CSS is not loaded for my dashboard?

Super_Knulps
Explorer

Hello,

I am trying to load the following CSS for my dashboard:
I am running this from my APP_HOME:

$ cat appserver/static/dashboard.css
     .section-title {
        font-size: 90px;
      }
     .panel_row1_col .layoutCell {
             width:1px !important;
     }
     .panel_row1_col .firstCell {
             width:800px !important;
     }

And here is the beginning of my dashboard and default.xml that I changed also:

$ head -n 1 default/data/ui/views/operator_dashboard.xml
<dashboard hideEdit="false" hideFooter="true" hideSplunkBar="true" hideAppBar="true" stylesheet="dashboard.css">

$cat default/data/ui/nav/default.xml
<nav search_view="search" color="#65A637">
  <view name="operator_dashboard" default='true' stylesheet="dashboard.css"/>
  <view name="dashboards" stylesheet="dashboard.css" />
</nav>

The CSS is there in my browser:
alt text

But it looks like it is not applied.
What can I do wrong please ?
Thank you very much

0 Karma
1 Solution

aljohnson_splun
Splunk Employee
Splunk Employee

i don't think you can reference stylesheet in the nav default.xml file.
I don't see any examples here (however, i could be wrong).

dashboard.css is the default that is already applied - are you trying to add to it or replace it ?
try naming your dashboard.css something else.

have you restarted splunkweb, $SPLUNK_HOME/splunk/bin/splunk restart splunkweb since you uploaded the css file?

lastly, look at the answer here by rocket66, which i think is relevant.

View solution in original post

aljohnson_splun
Splunk Employee
Splunk Employee

i don't think you can reference stylesheet in the nav default.xml file.
I don't see any examples here (however, i could be wrong).

dashboard.css is the default that is already applied - are you trying to add to it or replace it ?
try naming your dashboard.css something else.

have you restarted splunkweb, $SPLUNK_HOME/splunk/bin/splunk restart splunkweb since you uploaded the css file?

lastly, look at the answer here by rocket66, which i think is relevant.

Super_Knulps
Explorer

This made it. Here is a quick feedback:
default.xml does not have to be touched indeed.
dashboard.css name works well.
service splunk restart also restarts splunkweb so that was not the problem.
I changed the CSS to the one given by rocket66 and it was actually used.
So, the problem was my CSS.

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...