How to Create a Dark Theme for your GoodData Workspaces

  • 18 May 2021
  • 2 replies
  • 118 views

Introduction 

The GoodData Platform allows you to create custom themes for your Workspaces, including changing colors of different UI components or using a custom font on your dashboards. 

 

Recently, GoodData expanded the theming capabilities to allow defining a so-called complementary color palette, which allows users to easily customize the look and feel of KPI Dashboards without defining the color for each UI component individually. You can set as little as 2 and up to 10 colors and the other colors on the dashboard will automatically adjust accordingly.

 

Here, I will lay out the steps to create a “dark mode” theme for a dashboard. 

 

For more about creating custom themes, read our documentation page

 

Default theme:

MvBCcWeU8dbjiub3j8TSROe0Kz7MkcoBKKmVnuFjeGbxDAwLeQxtaiimQ1jK9yLxn0Va17GOSysZLmpntPbQ-OO17hQHeK-_W7EfdRpY6JugKk2BcK81CLlXoZDP2HFfvliGqgu0

“Dark mode” theme:

xg02rNzCTc8TUvw42xLKh6OFvI3zwb8UDuKmh6IfDrx6VxIMmJ-4NaC44Z_ZMhURRXf4IDXHbDOBdcuGZV8oiApvL4jdQdppQto6ce-9Ae0QDZEM8MkP0WIk-389S38Ppk3wgBew


 

Defining a custom theme

The first step is to create the custom theme object on the grey pages. 

 

Navigate to the Metadata Object Resource url for your workspace: https://secure.gooddata.com/gdc/md/{workspace_ID}/obj

Replace {workspace_ID} with your workspace’s ID. Also, if you are a GoodData Growth user or have a white-labeled domain, make sure to replace secure.gooddata.com with your domain’s URL.

 

The page will look like below:

YDsdRSR4QYipbwmkptRKrUsCYWSjako9DLPij6Z6NN281YrAMu69MSTrSUERbCT9a0Vat90TcMmKXTsT2H-RMX0uh6VqnIHnQ1OiusIZGcch7_eXKzPkJkL_IwnngWrvr1iPny8p

 

Here is a block of JSON that can be pasted into the “object definition” textbox to set a dark theme:

{
"theme" : {
"content" : {
"palette" : {
"complementary" : {
"c0" : "#272727",
"c9" : "#FFFFFF"
}
}
},
"meta" : {
"category" : "theme",
"deprecated" : "0",
"isProduction" : 1,
"summary" : "",
"tags" : "",
"title" : "Dark mode theme"
}
}
}

The “content” section of this JSON sets the actual configurations for the theme, and the “meta” section defines the metadata for the theme. Both sections are required. For the “content”, you can set the color for each of the supported UI components individually (read the documentation here), or you can use the complementary palette feature as shown in this example to simply set only the values “c0” (background color) and “c9” (foreground color), using their RGB hex codes, and have the platform generate complementary values for the remaining “c1” through “c8” colors. You can also manually set values for “c1” through “c8” if you don’t want the colors to be set automatically for you. Or you can set just a few of the values (for example, you can set “c0”, “c3”, and “c9” as your “anchor” colors and all the other colors will be calculated and set to values between each anchor). For a dark theme, “c0” should be your darkest color (for example, “#000000” for black or “#272727” as used in the above example for a very dark grey), and “c9” should be your lightest color (such as “#FFFFFF” for white). For more examples of theme configurations, refer to our documentation pages.

 

Simply copy and paste the above JSON into the textbox and click “Submit”. 

 

You will then see the following, notifying you that the theme was created successfully: 

93NN0h3bxoTcisSk3a-sATzb3b4ioVhUjw-dQ4d_Pv12MQ-0N7AGirISI5Hg42EQPExT1-bHMOTyDl2xQ_q9lMT4Ydh4ToVzPMb5gHyCM8AvlXSPBECMqIDQFhktm1glpajjnnzm

 

Click on the “uri” link here to navigate to the theme’s object page.

 

On this page, obtain the theme’s identifier (we will use this value in the next step):

N5SpJSU7TJKm1qQhg1sHFRiDDiPCJMXLHOrBHA8BR4Z81A-r4MUML03UQFIEHlCv6vi0TUmaHpDCl_JCDggF4Hm6xsmLTuANraPtwWJ70KXshxzdRjTo9F1dUBsTeKZwXJK-ank0

 

Alternatively, you can find the theme’s identifier by navigating to: https://secure.gooddata.com/gdc/md/{workspace_ID}/query/themes

 

This page will list all the themes you have created. Clicking on one of the themes will navigate you to that theme’s object page, where you can find the identifier. 

 

Activating your custom theme

Now that you’ve created your theme, you will need to activate it for your workspace. 

 

Navigate to: https://secure.gooddata.com/gdc/projects/{workspace_id}/config/ 

 

Scroll to the bottom of the page and find the “Create Config” section:

5gwSH616b6_8rZekqh5yYRB-ohGmHQSAiGzOk1Sst6fPUbUDN7l1EzmyFcmF0dkp3AnSoa84WdRdvpQq5XOo65yphomRNv6ePgteU_XmKJZCr7t1zy2lg-uFP5p8iXn56gZpXna8

 

In the “Key” field, type “selectedUiTheme” and in the “Value” field, paste your theme’s identifier. 

 

Click “Create config”.

 

You will see the following page, notifying you the theme was activated:

G4xtJl7bdu_soVFOe1HLsOMn8lbCayBLfY7SoH1BD8deEa-rw4lNu7T0GXnBDG_TpyeRL7V3yWN3sjrm1wKbzrdzqYdiHzxqn2Bscfgc0QP5NHFOgkPN69twAI7GGwQ2QXOYJvmD

 

Navigate to your workspace’s dashboard to verify your theme is now active:

mJrQTe24W7ClwdbxPc3LO49hITfIYGVmhnPuBQzDMv8OznQYAIIju_IQRiXsfWDsjrA1H_CX-M5e21O2pn0LUH2ihQLBH3irFAT_2FOoreoJcjvOpRVhjyGsZbZJAfBY1GuBDsTG

 

You’ve just created and activated a dark theme for your workspace!

 

Restoring the default theme

If you want to revert your workspace to GoodData’s standard theme, simply navigate to the workspace’s config page: https://secure.gooddata.com/gdc/projects/{workspace_id}/config/ 

 

Scroll to the bottom of the page and, just as before, type “selectedUiTheme” in the “Key” field, but this time leave the “Value” field blank, and click “Create config”:

QQOscgLfwGvwUwM_dkd_E0-1xIzGRXEkUpYGNHlCPs5rkZL5Zdf7aIu4afSPA4BTN6QMDkAwpLSlWQG5Wpih2aBllZa8AerMxiRrK-5cVsavYiyWThZDaire0JLIrDwdGOTyZfIe

 

This will restore the default theme for your workspace. 

 

The custom theme you defined will still exist but it will no longer be activated for your workspace. You can always re-activate it by navigating back to this config page and entering “selectedUiTheme” in the “Key” field and the theme’s identifier in the “Value” field.

 

Additional Considerations

This article covered using the complementary palette to set the color of dashboard components, but you can also configure the border size, font, or other UI components. Refer to our theme properties documentation for a full list and explanation of the properties you can set. For more theme examples, check out our documentation page. You can always start with the examples provided and edit them to your liking, or create your own layout from scratch. 

 

You can create and maintain multiple themes for each workspace. As mentioned above, you can navigate to the themes grey page to see all the themes you currently have defined: https://secure.gooddata.com/gdc/md/{workspace_ID}/query/themes

Only one theme can be active at a time, and if you are maintaining multiple themes, you can easily switch between them by updating the workspace’s config page. 

 

You can also edit existing themes by navigating to https://secure.gooddata.com/gdc/md/{workspace_ID}/obj/{object_ID}?mode=edit. Note that the object ID in the URL here is different from the theme’s identifier and can be found in the URL of the theme’s grey page. To find it, navigate to the themes grey page: https://secure.gooddata.com/gdc/md/{workspace_ID}/query/themes. Click on the theme you want to edit to navigate to its page; the object ID is the value at the end of the URL here:

HbGGUJ7SyFNSw-TG3WRRGPV3SFD_i0TLr24pFcgltK0xaTySILKEXYNsnaAi7-NxkDmtyfD6_YtbAucT-p-1GZEOeNVxXJC0DNokvnnoReT1BJXFpcpykE2TsywbKLQvel2bwjiN

In fact, if you’ve navigated to this page, all you have to do is append “?mode=edit” to the end of the URL. Edit the values you want to change and click “Submit” to save the changes.

 

If you are using Lifecycle Management (LCM), you can update the theme for multiple workspaces at the same time by setting the theme for the Master workspace and then running the Rollout Brick to update all of the client workspaces. Read more about managing themes with LCM on our documentation page


2 replies

Hi there,

I have tried this process multiple times but I am not seeing any result when refreshing the dashboard in the project. All of the steps have been completed and I can confirm the selectedUiTheme is applied to the config. Is this still working?

Hi Joe, 
Which pricing plan are you on and are you an admin user for your domain? 

Thanks,
Kyle

Reply