Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize Disqus

I've just integrated Disqus in a Wordpress theme that I'm developing. Everything works fine except the CSS. How can I apply my own css style to Disqus ?

In my .less file, I wrote this :

#disqus_thread {
    position: relative;
    display:block;
    margin: 0 0 20px 0;
    padding: 20px;
    line-height: 1.5;
    color: @brandGray !important;
    background-color: @white;
    .flat-box-shadow;
    overflow: hidden;
    clear: both;

    iframe {

        body.dark {

            #layout {

                #main-nav {

                    nav {

                        a {
                            color: @brandViolet !important;

                            &:link,
                            &:visited {
                                color: @brandViolet !important;
                            }

                            &:hover,
                            &:active,
                            &:focus {
                                color: @lightViolet !important;
                            }

                        }

                    }

                }

            }

        }
    }
}

But it doesn't work at all. I searched on the Internet and I found that my css style will not be applied because Disqus is in a iFrame. And I can find antyhing to customize Disqus in the admin panel. So, how can I solve this ?

I work on localhost. Could it be a problem?

Many thanks!

like image 442
Lancelot Avatar asked Nov 02 '22 01:11

Lancelot


1 Answers

Repeating what @Assaf wrote but the current instructions for disqus styling are here.

They make it clear you can't style everything, only a few select things. For example for links you can set the color but not much else. I tried this on my own blog and it worked

#disqus_thread a {
  color: red;
}

But I also tried this

#disqus_thread a {
  color: red;
  font-weight: bold;           /* no effect */
  text-decoration: underline;  /* no effect */
}

According to those docs, things you can set.

  • Choose the light or dark theme

    It's set on the admin page under Admin > Setup > Appearance

  • Set the color of paragraphs and links

    #disqus_thread p {
      color: green;
    }
    #disqus_thread a {
      color: red;
    }
    
  • Set the width of the comments

    #disqus_thread {
      width: 700px;
    }
    
  • Add your logo if you pay for the Pro version

like image 80
gman Avatar answered Nov 09 '22 05:11

gman