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!
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
But I also tried this
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
Set the width of the comments
Add your logo if you pay for the Pro version
Reference: http://casadeblundell.com/jonathan/custom-styling-for-disqus-css/
Since disqus inherits the colors from its parent element, the simplest way is to add a wrapper and style it:
A simple tricks for changing Disqus background . If you are using a “disqus-comment-system” plugin , then open comments.php file . and search for disqus_thread id. Now add your own class. for example :
<div id="disqus_thread" class="myclass">
And finally add this class on your css file . and change whatever you want. like : padding, background ,,etc
This same technique works in other discuss plugin as well.
Thanks