Delete a theme

This procedure explains how to delete a theme from a customization project.

Before you begin

  • The theme must be defined in the file gbc-project-dir/customization/customization-project-dir/config.json.

  1. Open the gbc-project-dir/customization/customization-project-dir/config.json file.
  2. Locate the theme.

    Each theme is contained within curly braces within the "themes" element, and can be identified by its "name".

    {
      "themes": [{
          "name": "default",
          "title": "Default",
          "uses": ["platform/desktop"]
        },
        {
          "name": "dark",
          "title": "Dark",
          "uses": ["platform/desktop", "common", "colors/dark"]
        },
        {
          "name": "default_mobile",
          "title": "Default",
          "uses": ["platform/mobile"]
        }
      ]
    }

    In this example, there are three themes defined: "default", "dark", and "default_mobile".

  3. Remove the theme from the file.

    In our example, you simply remove the "dark" theme definition to remove the "dark" theme:

    {
      "themes": [{
          "name": "default",
          "title": "Default",
          "uses": ["platform/desktop"]
        },
        {
          "name": "default_mobile",
          "title": "Default",
          "uses": ["platform/mobile"]
        }
      ]
    }
  4. Save your changes and rebuild your customization using gbc build:
    $ gbc build --customization customization-project-dir
  5. Verify the theme has been removed by closing and reopening your application, then try and set your theme to the removed theme. It should not be present in the list.
    Tip:

    You may need to use CTRL + F5 to clear the browser cache before you see your changes.