Help center CSS cookbook

Return to top

40 Comments

  • Budke, John

    Hi Ginger:

    I just did this the other day.  In my style sheet it's line 1611, under upload-dropzone.  You'll see the last line I added is the background color.  I also resized the drop zone.

    .upload-dropzone span {
    color: lighten($text_color, 20%);
    font-size: 15px;
    height: 80px;
    width: 300px;
    border: 2px solid #000000;
    border-radius: 4px;
    background-color: #ccf5ff;

    This is the result:

    Hope this helps.

    1
  • Amy Gracer
    Community Moderator

    Isaac Starobin

    I think what is happening is that you are including all OL within article body. So you'd handle that with ol class that says to use your special coding only when you apply that special class.

    I hope that's enough for you to get started on. I haven't played around with this kind of styling in a while, so I can't write out the exact statement now, but if you need more help (and no one else more experienced jumps in), I'll play around with it and figure it out.  Let me know and good luck!

     

     

    1
  • Brett Bowser
    Zendesk Community Manager

    Thanks so much for sharing your solution John! This is super helpful :)

    1
  • Ian Morgan

    Hi Amy

    Thank you so much for your continued support both here and in my other post regarding the sign-in drop-down. This community has been great in helping me resolve issues as I have been learning how to modify our website.

    I have tried what you suggested and as you suspected there is an error in my code. It appears to be in my CSS file so I am in the process of comparing my CSS to the CopenHagen version. I will update here when I find my mistake for the benefit of others who may see the same issue.

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Thanks for sharing! I just tried a for loop on my new request page and I was getting a similar linting "error", but when I loaded the page, it was executing properly. I can bring this to our dev team to see what's going on here, but first I'd like to know if you're seeing the same behavior as I am. Just let me know if the code is working and if it is, at least we know that's not the issue and we can narrow the scope of the fix.

    0
  • Casey Keefe

    Hi Everyone - Anyone have any ideas why the closing tag for <script> here is showing in red? I've gone line-by-line, but can't seem to figure it out. Thanks in advance!

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Jessica! If you go to the header.hbs template, you can just wrap the existing community block with a conditional to check if the user is signed in, like this:

     {{#if signed_in}}
      <li>{{link 'community'}}</li>
    {{/if}}
    0
  • Stephen Kairys

    I'll take a look next week. Thank you.

    0
  • Isaac Starobin

    I'm trying to customize the numbers in ordered lists so they have pretty circled backgrounds. I started with this CSS:

    .article-body ol {list-style: none; counter-reset: li}
    li::before {content: counter(li); color: red;
      display: inline-block; width: 1em;
      margin-left: -1em}
    li {counter-increment: li}

    It did indeed format the numbers, but it also added numbers to some very strange places around the article page, like the social icons on the bottom.

    Any ideas how to modify the CSS so that it applies ONLY to ordered lists within the article body?

    Thanks!

    0
  • Ian Morgan

    Hi Amy. 

    That is definitely possible. Here is the code. I can't see a problem but it might be obvious to someone with better knowledge.

    Thanks again

    <section class="categories blocks">
    <div class="container">
    <ul class="blocks-list">
    {{#each categories}}
    {{#if ../has_multiple_categories}}
    <li class="blocks-item">
    <a href='{{url}}' class="blocks-item-link">
    <span class="blocks-item-title">{{name}}</span>
    <div class="blocks-item-description"> {{excerpt description}}</div>
    </a>
    </li>
    {{else}}
    {{#each sections}}
    <li class="blocks-item">
    <a href='{{url}}' class="blocks-item-link">
    <span class="blocks-item-title">
    {{name}}
    </span>
    <div class="blocks-item-description">{{excerpt description}}</div>
    </a>
    </li>
    {{/each}}
    {{/if}}
    {{/each}}
    </ul>
    {{pagination}}
    </div>
    </section>

    0
  • Justina Thompson

    What would the code be to add a horizontal line divider between article titles on the category and see all article pages?

    0
  • Ian Morgan

    Thank you Amy

    I tried min-width as well but all this did was remove the description from the wider screen. 

    Thank again.

    0
  • Timo Boezeman

    Thanks Christopher Stock!

    0
  • Isaac Starobin

    Amy Gracer Amy Gracer

    Thanks for taking a look! Unfortunately this looks like it's beyond my very limited CSS capabilities. If you have any ideas, I'm all ears!

    0
  • Jeff C
    Zendesk Customer Care

    Hey Jane,

    I would suggest that you reach out to us via Option 2 mentioned here so we can look further into your request. I'd like to set your expectation though that custom code is outside scope specially if your Copenhagen theme is customized but we will be happy to provide options.

    0
  • Max

    Hello there, 

    I am trying to modify the appearance of Send a request link button, but nothing changes.. I am with Copenhagen v3.1.0. Is it because the colour chosen on the homepage og theming is overriding my code ? 

    Here is my code if it can help

    /***** Change style of the request button *****/
    .submit-a-request {
      font-size: 14px;
    color: #B78A6B;
      background: #ffffff;
    }

    Thank you loads !

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Casey! It's difficult to say for sure, but one possibility is that you're adding this to your script.js file, that could be one possibility. You don't need to wrap any js code in script tags on that file, so this is one possible error that would show up. If that isn't what you're doing, could you let me know which file you're adding this to?

    0
  • Eric Nelson
    Zendesk Developer Advocacy
    Hey David,
     
    You could definitely do this. The best way to do this would be to write a comparative date checking function that shows / hides the custom element depending on the date.
     
     
    The below example would show or hide a custom element named "myBanner" depending on if the date matches the one provided. 
     
    function isToday(date) {
    const today = new Date();

    if (today.toDateString() === date.toDateString()) {
    return true;
    }
    return false;
    }

    if (isToday(new Date('Nov 10 2022')) === true){
    document.getElementById('myBanner').style.display = 'block';
    }
    else {
    document.getElementById('myBanner').style.display = 'none'
    }
     
    0
  • Eric Nelson
    Zendesk Developer Advocacy
    Hey Don,

    The easiest way to handle this is to create a separate stylesheet instead of on the entry level. 

    <link rel="stylesheet" media="screen" href="main.css" />
    <link rel="stylesheet" media="print" href="print.css" />

    Hope this helps!
    0
  • Gorka Cardona-Lauridsen
    Zendesk Product Manager

    Hi All, 

    We are conducting research to improve our Help Center developer experience and would love to talk to any of you that have tried to edit Help Center theme code.

    If you are interested please answer sign up here and answer the 3 survey questions. I will reach out to you to setup a 30 min Zoom call.

    The interview will be a semi-structured interview where we would like to hear you take us through examples of what you have done or tried to do with customizations and your experience with the tools, documentation etc. you used.

    Looking forward to talking to all of you.

    Gorka Cardona-Lauridsen
    Sr. Product Manager, Zendesk Guide 

    0
  • Brett Bowser
    Zendesk Community Manager
    Hey Stephen,
     
    It looks like you got a response around setting this up in the following post: Table of contents?
     
    Hope this points you in the right direction!
    0
  • Jana Debusk
    Zendesk Luminary

    We have the Copenhagen theme, and all of the images within articles are being changed to "avatars" when published (they are full size in the draft). Any advice on how to fix this with the CSS? 

    0
  • Timo Boezeman

    Hi,

    I'm busy altering our Guide theme, which is going perfectly well, except for one element which I can't seem to find in the style.css file.

    What I want, is to change the appearance of the instant search results dropdown. But I really have no clue where to find the classes.

    This is the dropdown I'm talking about:

    0
  • Jessica Peck

    Greg-Katechis that worked, thank you!  I modified a bit so it wouldn't add spaces:

      {{#if signed_in}}
        {{link 'community'}}
     {{/if}}

    Thanks again!

    0
  • Andrey Nikolaev

    Can I change an article's CSS template for just one section or category rather than the entire Help Center?

    0
  • Amy Gracer
    Community Moderator

    Hi Justina,

    You can use border-top

    For example, 

    .section-tree-title {
    1. margin-bottom: 0;
    2. font-size: 18px;
    3. font-weight: 600;
    4. color: #333333;
    5. margin-top: 10px;
    6. border-top: #336699 1px solid;
    }
    I'm not exactly sure what element you want to apply this to, but the border-top should work. 
     
     
    0
  • Permanently deleted user

    I would like to do some advanced CSS in Guide, particularly accordions, but other things as well. I have tried several options recommended in the Community involving Bootstrap, but they don't seem to play well with Zendesk. I found Zendesk Garden (e.g., https://garden.zendesk.com/components/accordion), but it seems to revolve around building apps rather than modding the Zendesk Guide. Any suggestions?

    0
  • Casey Keefe

    Hi Greg-Katechis - Thanks! Yes, we have been getting the same result. This code has been on the live page for months with no reported issues as well.

    For a bit more scope - we are essentially trying to add some login functionality to one of the forms and when updating the code, I came across this script error, so figured I would try and fix it while adding the new functionality.

    0
  • Christopher Stock
    Community Moderator
    Zendesk Luminary

    Hey Timo Boezeman, it's added as a <zd-autocomplete> element. There are no css classes, but you can style the element directly.

    0
  • Casey Keefe

    Thank you Greg-Katechis ! This code is currently on new_request_page.hbs

    0

Please sign in to leave a comment.

Powered by Zendesk