Do you guys face this? If you pay attention you'll...
# compose-web
l
Do you guys face this? If you pay attention you'll see that on all margins there's a small white 'padding', although I didn't configure any spacing on the sides. Is it possible to disable this? Or is this just the standard? (Backender Kotliner trying to play with frontend a bit 😅 )
✅ 1
g
If you right click on the page and "inspect", you can see the html that is generated for the page, what classes are applied to each tag, and what css is in those classes. There's probably a margin in there somewhere.
l
I couldn't find any margin or padding on inspect. Although if I do
margin = -10px
on root it will remove this white border
I think it's on
body
by default
g
Is there a css class applied to the body?
l
No, there's nothing applied to the body. I mean, there is now:
Copy code
<body style="margin: 0">
        <div id="root"></div>
        <script src="SeMudandoFront.js"></script>
    </body>
as this will fix the white margin, but it seems weird to me to have to apply this
g
there could be a .body css selector in the stylesheet, applying a margin.
l
The default stylesheet is empty
Copy code
object AppStyleSheet : StyleSheet() {
    val primary = Color("#023e8a")
    val primaryLight = Color("#02558b")

    val accent = Color("#eb4a3b")
    val accentLight = Color("#d9554d")
}
g
if there is, the style attribute in the html will override that.
l
The code is available here: https://github.com/SeMudando/SeMudandoFront If you want to take a close look
g
Is this whole page generated with compose-web, without any css file?
l
No css file, that's correct. Only the StyleSheet
g
So you'll need to fix it by setting the body margin to 0
l
Ah, I see, so this isn't an issue with compose itself. Interesting that this is the default behavior! Thanks for the help, @Greg Steckman!
I've turned our conversation into a Q/A in stackoverflow. Maybe this question pops up in the future https://stackoverflow.com/questions/69337324/white-border-on-webpage/69337325#69337325
Oh I just read your stack overflow answer seems like you fixed it already yourself. Yes this was a "fun" few hours of a rabbit hole I also encountered and couldn't figure out at first