2019-09-22 18:26:28 +02:00
package moe.kageru.kodeshare.pages
import kotlinx.css.*
2019-09-29 11:50:14 +02:00
import kotlinx.css.properties.*
2019-09-22 18:26:28 +02:00
object Css {
2019-09-29 11:50:14 +02:00
const val FLOATY _CLASS = " floatything "
2019-09-29 08:17:31 +02:00
private val accent1 = Color ( " #e6db74 " )
private val accent2 = Color ( " #a6e22e " )
2019-09-22 18:26:28 +02:00
private val fontcolor = Color . lightGrey
2019-09-29 08:17:31 +02:00
private val bgcolor = Color ( " #23241f " )
2019-09-22 18:26:28 +02:00
val default = CSSBuilder ( ) . apply {
body {
fontFamily = " Hack, Fira Code, Noto Mono, monospace "
fontSize = 13. pt
textAlign = TextAlign . center
margin = " auto "
2019-09-29 08:17:31 +02:00
backgroundColor = bgcolor
2019-09-22 18:26:28 +02:00
color = fontcolor
}
2019-09-29 11:50:14 +02:00
form {
marginTop = 1. em
}
2019-09-22 18:26:28 +02:00
textarea {
fontFamily = " Hack, Fira Code, Noto Mono, monospace "
2019-09-29 08:17:31 +02:00
backgroundColor = bgcolor
2019-09-22 18:26:28 +02:00
color = Color . white
fontSize = 13. pt
borderColor = accent1
borderWidth = 3. px
borderRadius = 8. px
borderStyle = BorderStyle . solid
padding = " 5px "
minWidth = 70. pct
2019-09-29 11:50:14 +02:00
maxWidth = 97. pct
2019-09-22 18:26:28 +02:00
}
2019-09-29 08:17:31 +02:00
// this doesn’t inherit the style from anything else for some reason
2019-09-29 09:51:15 +02:00
rule ( " .hljs, pre, code " ) {
2019-09-29 10:15:42 +02:00
width = 95. pct
2019-09-29 08:17:31 +02:00
height = 100. pct
textAlign = TextAlign . left
fontFamily = " Hack, Fira Code, Noto Mono, monospace "
fontSize = 13. pt
2019-09-29 10:15:42 +02:00
display = Display . inline
position = Position . relative
2019-09-29 08:17:31 +02:00
}
2019-09-22 18:26:28 +02:00
rule ( " input[type= \" submit \" ] " ) {
backgroundColor = accent1
borderColor = accent1
borderWidth = 2. px
borderRadius = 5. px
borderStyle = BorderStyle . solid
color = Color . black
fontWeight = FontWeight . w600
padding = " 5px 15px "
cursor = Cursor . pointer
transition ( duration = 500. ms )
}
2019-09-29 11:50:14 +02:00
rule ( " div. $FLOATY _CLASS " ) {
2019-09-29 10:15:42 +02:00
position = Position . absolute
padding = " 5px "
border ( 2. px , BorderStyle . solid , accent1 )
borderRadius = 3. px
color = accent1
top = 1. em
right = 1. em
zIndex = 1
}
2019-09-29 11:50:14 +02:00
rule ( " div. $FLOATY _CLASS:hover " ) {
color = accent2
borderColor = accent2
}
rule ( " div.wrapper " ) {
margin = " auto "
lineHeight = LineHeight ( " 140% " )
width = 70. pct
textAlign = TextAlign . left
}
rule ( " .framed " ) {
border ( 1. px , BorderStyle . solid , fontcolor )
padding = " 0.3em "
margin = " 0.5em "
marginBottom = 1. em
}
2019-09-22 18:26:28 +02:00
rule ( " input[type= \" submit \" ]:hover " ) {
backgroundColor = Color . transparent
2019-09-29 08:17:31 +02:00
borderColor = accent2
color = accent2
2019-09-22 18:26:28 +02:00
}
rule ( " textarea:focus " ) {
borderColor = accent2
}
rule ( " ::selection " ) {
color = accent1
}
2019-09-29 10:15:42 +02:00
a {
color = accent1
textDecoration = TextDecoration . none
}
rule ( " a:visited " ) {
color = accent1
}
rule ( " a:focus " ) {
color = accent2
}
2019-09-22 18:26:28 +02:00
} . toString ( )
}