Currently the 'themes' directory live under cdap/cdap-ui/server/config, and the user can drag and drop a theme of their own into this directory to be applied in the UI. However, this directory will be overwritten when CDAP is upgraded. One way to get around this is to allow the user to specify a directory on their file system where their themes live, in addition to a default theme directory that we specify. This way, when CDAP is upgraded, the default theme might be changed, but the user's specified directory will not, and they can keep their customizations.
To do this, we need to update cdap-default.xml and cdap-site.xml to have theme-related properties, such as 'ui.theme.dir' and 'ui.theme'. The 'ui.theme.dir' will be a semicolon-separated list of directories, where the user can link to their custom theme directory, and the 'ui.theme' will specify the theme UI should use. We'll also need to update the CSD and Ambari configs as well.