Skip to content

Commit

Permalink
Merge pull request #692 from jenshalm/site/color-props
Browse files Browse the repository at this point in the history
TypelevelSiteSettings - deprecate top level color properties in favor of a nested object
  • Loading branch information
armanbilge authored Apr 11, 2024
2 parents 72b5854 + 05100a6 commit d66d4be
Showing 1 changed file with 73 additions and 44 deletions.
117 changes: 73 additions & 44 deletions site/src/main/scala/org/typelevel/sbt/site/TypelevelSiteSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,33 @@ object TypelevelSiteSettings {
Favicon.external("https://typelevel.org/img/favicon.png", "32x32", "image/png")
)

// light theme colours
// Tl suffix indicates these are lifted directly from somewhere within the Typelevel site
// val redTl = Color.hex("f8293a")
val brightRedTl = Color.hex("fe4559")
val coralTl = Color.hex("f86971")
val pinkTl = Color.hex("ffb4b5")
val whiteTl = Color.hex("ffffff")
val gunmetalTl = Color.hex("21303f")
val platinumTl = Color.hex("e6e8ea")
// Extra colours to supplement
val lightPink = Color.hex("ffe7e7")
val slateBlue = Color.hex("385a70") // 406881 (original slateCyan)
val mediumSlateCyanButDarker = Color.hex("8ebac7")
val mediumSlateCyan = Color.hex("b0cfd8")
val lightSlateCyan = Color.hex("ddeaed")
val lighterSlateCyan = Color.hex("f4f8fa")
val softYellow = Color.hex("f9f5d9")
private object colors {
val primary = Color.hex("385a70")
val primaryMedium = Color.hex("8ebac7")
val primaryLight = Color.hex("f4f8fa")
val secondary = Color.hex("fe4559")
val text = Color.hex("21303f")
val background = Color.hex("ffffff")
val landingPageGradient = Color.hex("b0cfd8")
val info = Color.hex("ddeaed")
val warning = Color.hex("f9f5d9")
val error = Color.hex("ffe7e7")

val syntaxBase: ColorQuintet = ColorQuintet(
colors.text, // background
Color.hex("73ad9b"), // comments
Color.hex("b2adb4"), // punctuation
Color.hex("ffb4b5"), // identifier
Color.hex("e6e8ea") // unclassified
)
val syntaxWheel: ColorQuintet = ColorQuintet(
Color.hex("8fa1c9"), // substitution, annotation
Color.hex("81e67b"), // keyword, escape-sequence
Color.hex("ffde6d"), // declaration name
Color.hex("86aac1"), // literals
Color.hex("f86971") // type/class name
)
}

val defaults: Initialize[Helium] = setting {
GenericSiteSettings
Expand All @@ -96,39 +106,58 @@ object TypelevelSiteSettings {
)
.site
.themeColors(
primary = slateBlue,
secondary = brightRedTl,
primaryMedium = mediumSlateCyanButDarker,
primaryLight = lighterSlateCyan,
text = gunmetalTl,
background = whiteTl,
bgGradient = (mediumSlateCyan, lighterSlateCyan)
primary = colors.primary,
secondary = colors.secondary,
primaryMedium = colors.primaryMedium,
primaryLight = colors.primaryLight,
text = colors.text,
background = colors.background,
bgGradient = (colors.landingPageGradient, colors.primaryLight)
)
.site
.messageColors(
info = slateBlue,
infoLight = lightSlateCyan,
warning = slateBlue,
warningLight = softYellow,
error = slateBlue,
errorLight = lightPink
info = colors.primary,
infoLight = colors.info,
warning = colors.primary,
warningLight = colors.warning,
error = colors.primary,
errorLight = colors.error
)
.site
.syntaxHighlightingColors(
base = ColorQuintet(
gunmetalTl,
Color.hex("73ad9b"), // comments
Color.hex("b2adb4"), // ?
pinkTl, // identifier
platinumTl // base colour
),
wheel = ColorQuintet(
Color.hex("8fa1c9"), // substitution, annotation
Color.hex("81e67b"), // keyword, escape-sequence
Color.hex("ffde6d"), // declaration name
Color.hex("86aac1"), // literals
coralTl // type/class name
)
base = colors.syntaxBase,
wheel = colors.syntaxWheel
)
}

@deprecated("color properties will be removed from public API", "0.7.0") val slateBlue =
colors.primary
@deprecated(
"color properties will be removed from public API",
"0.7.0") val mediumSlateCyanButDarker =
colors.primaryMedium
@deprecated(
"color properties will be removed from public API",
"0.7.0") val lighterSlateCyan = colors.primaryLight
@deprecated("color properties will be removed from public API", "0.7.0") val brightRedTl =
colors.secondary
@deprecated("color properties will be removed from public API", "0.7.0") val gunmetalTl =
colors.text
@deprecated("color properties will be removed from public API", "0.7.0") val whiteTl =
colors.background
@deprecated("color properties will be removed from public API", "0.7.0") val mediumSlateCyan =
colors.landingPageGradient
@deprecated("color properties will be removed from public API", "0.7.0") val lightSlateCyan =
colors.info
@deprecated("color properties will be removed from public API", "0.7.0") val softYellow =
colors.warning
@deprecated("color properties will be removed from public API", "0.7.0") val lightPink =
colors.error
@deprecated("color properties will be removed from public API", "0.7.0") val pinkTl =
colors.syntaxBase.c4
@deprecated("color properties will be removed from public API", "0.7.0") val platinumTl =
colors.syntaxBase.c5
@deprecated("color properties will be removed from public API", "0.7.0") val coralTl =
colors.syntaxWheel.c5

}

0 comments on commit d66d4be

Please sign in to comment.