diff --git a/src/main/kotlin/moe/kageru/kodeshare/pages/Css.kt b/src/main/kotlin/moe/kageru/kodeshare/pages/Css.kt index 724f2a5..3fdf5a8 100644 --- a/src/main/kotlin/moe/kageru/kodeshare/pages/Css.kt +++ b/src/main/kotlin/moe/kageru/kodeshare/pages/Css.kt @@ -6,8 +6,9 @@ import kotlin.math.ceil object Css { const val FLOATY_CLASS = "floatything" - private val accent1 = Color("#e6db74") - private val accent2 = Color("#a6e22e") + private val accent1 = Color("#e6db74") // monokai yellow + private val accent2 = Color("#a6e22e") // monokai green + private val selection = Color("#66d9ef") // monokai blue private val fontcolor = Color.lightGrey private val bgcolor = Color("#23241f") @@ -18,7 +19,7 @@ object Css { // 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 const val fonts = """Hack, "Jetbrains Mono", "Fira Code", "Noto Mono", monospace""" private fun StyledElement.defaultBorder() = border(borderpixels.px, BorderStyle.solid, accent1) @@ -116,7 +117,8 @@ object Css { outline = Outline.none } rule("::selection") { - color = accent1 + backgroundColor = selection + color = bgcolor } a { color = accent1 diff --git a/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt b/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt index 5ee96a6..676d1bd 100644 --- a/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt +++ b/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt @@ -9,17 +9,24 @@ object PastePage { defaultHead("View paste $uri${type?.let { " (type $it)" } ?: ""}") link( rel = "stylesheet", - href = "https://p.kageru.moe/static/hljs.css", + href = "/static/hljs.css", type = "text/css" ) - script(src = "https://p.kageru.moe/static/hl.js") {} + script(src = "/static/hl.js") {} // Show the first 3 lines in preview/embed for applications like discord, slack, or skype meta(content = content.lines().take(3).joinToString("\n")) { attributes["property"] = "og:description" } unsafe { +"" - +"" + // TODO: find out how CSSBuilder.fontFace is supposed to work and use that instead + +"""""".trimIndent() } } body {