question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content width not set properly

See original GitHub issue

Even though default styles were defined in PR#102, I’m still experiencing width setting issues:

Capture

Both rules added in that PR are set properly in the inline stylesheet but .gsc-comments is still missing 1 or 2 pixels worth of padding-right. Here’s a live demo if you need to give it a spin yourself.

Thanks 💪

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
barnumbirrcommented, Sep 16, 2021

If that’s too much hassle for you, try this in your extra.css instead:

.md-main .md-content > .md-content__inner.md-typeset {
    margin-left: 1.1rem;
    margin-right: 1.1rem;
}

That fixes it indeed. Issue is also present on Microsoft Edge but not on Chromium nor Firefox Mobile. Don’t really have an idea if this is a browser or theme issue so not sure where to report it. I’ll close this issue for now.

0reactions
laymonagecommented, Sep 16, 2021

@barnumbirr You’re not supposed to put the custom CSS for giscus on your website. The widget is loaded in an <iframe> so your styles won’t have any effect. You need to use a custom giscus theme via the data-theme attribute. The CSS that you put on your website can only be used to style the <div> wrapper or the <iframe> itself (useful for simple use cases e.g. limiting the height to make it scrollable), but not the <iframe>'s content, which is what’s necessary to apply the padding-right: 1px hack.

If that’s too much hassle for you, try this in your extra.css instead:

.md-main .md-content > .md-content__inner.md-typeset {
    margin-left: 1.1rem;
    margin-right: 1.1rem;
}

It’s probably a bug in either the Material MkDocs theme or Firefox, maybe you could open an issue there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Height and width not working on CSS Content property
I am trying to achieve; a line before and after content spanned on entire width. The width and height properties do work, try...
Read more >
width - CSS: Cascading Style Sheets - MDN Web Docs
The width CSS property sets an element's width. By default, it sets the width of the content area, but if box-sizing is set...
Read more >
width | CSS-Tricks
The width property in CSS specifies the width of the element's content area. This "content" area is the portion inside the padding, border, ......
Read more >
Setting Height And Width On Images Is Important Again
To prevent layout shifts and improve performance scores, we need to always set width and height attributes on our images.
Read more >
HTML vs Body: How to Set Width and Height for Full Page Size
Not setting a width on the HTML and body elements will default to the full size of the screen. If you do set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found