5

When creating a community, you can override the CSS of a template.

Use custom CSS to override the default template and Branding panel styles. We recommend that you use custom CSS sparingly, because future releases of template components might not support all CSS customizations.

I'd like to backup my custom CSS in source control. I've seen this post on getting metadata for a community. Following it, I did wildcards on CommunityThemeDefinition and CommunityThemeDefinition as well, assuming my CSS is stored in on of those metadata types.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>CommunityTemplateDefinition</name>
    </types>
    <types>
        <members>*</members>
        <name>CommunityThemeDefinition</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomSite</name>
    </types>
    <types>
        <members>*</members>
        <name>Network</name>
    </types>
    <types>
        <members>*</members>
        <name>SiteDotCom</name>
    </types>
    <version>43.0</version>
</Package>

I didn't see any CSS in what was returned. In fact, no metadata folders with names similar to CommunityThemeDefinition and CommunityThemeDefinition were in the source that I pulled using package.xml. My siteDotComSites folder had a binary file, but I don't want to trust that it contains my custom CSS.

For those of you who are not aware, to override template CSS, you need to go into the Theme Settings in Builder, like so:

enter image description here

enter image description here

6

The sad truth is, virtually the entirety of the configuration you can do in Community Builder is saved in that monolithic binary.

If you want to know whether to "trust" that the binary contains your custom CSS...

  1. Spin up a sandbox.
  2. Open Community Builder in the sandbox and verify what you see in the CSS.
  3. Change the CSS in the sandbox.
  4. Create a change set from production to sandbox containing the Community binary.
  5. Deploy, and check again what you see in CSS for the sandbox.
  • The CSS is stored in the site binary. – Tyler Zika Aug 9 '18 at 18:16
  • Sorry to hear. At least now we know. – Charles T Aug 9 '18 at 21:12
0

You can also link your CSS in the Advanced > Head Markup settings to a static resource.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.