Fix pastes being centered without JS

This commit is contained in:
kageru 2020-04-12 11:01:42 +02:00
parent fc88a90703
commit b3e77e37e0
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

@ -14,9 +14,11 @@ object Css {
private const val borderpixels = 3
private const val bodyPadding = 20
private const val inputPadding = 8
// Text areas apparently grow beyond their parent element if padding and/or borders are added.
// They always grow to the right, so we simply add more padding to shift everything back (see usage of this).
private const val bodyShift = bodyPadding + 2 * borderpixels + 2 * inputPadding
const val fonts = """Hack, "Jetbrains Mono", "Fira Code", "Noto Mono", monospace"""
private fun StyledElement.defaultBorder() = border(borderpixels.px, BorderStyle.solid, accent1)
@ -28,9 +30,8 @@ object Css {
transition(duration = 400.ms)
}
body {
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
fontFamily = fonts
fontSize = 13.pt
textAlign = TextAlign.center
margin = "auto"
backgroundColor = bgcolor
color = fontcolor
@ -44,9 +45,10 @@ object Css {
form {
width = 100.pct
marginTop = 0.px
textAlign = TextAlign.center
}
textarea {
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
fontFamily = fonts
backgroundColor = bgcolor
color = Color.white
fontSize = 13.pt
@ -61,7 +63,7 @@ object Css {
width = 95.pct
height = 100.pct
textAlign = TextAlign.left
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
fontFamily = fonts
fontSize = 13.pt
display = Display.inline
position = Position.relative