From c60b5a3ad7a0c705423382ec3aedc5b6fd8fe061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=81ukasik?= Date: Tue, 5 Jul 2022 10:12:53 +0200 Subject: [PATCH 01/14] change color of grey-12 color token, fix header margins, change order of switcher elements, remove border from gh link --- scaladoc/resources/dotty_res/styles/theme/colors.css | 2 +- .../styles/theme/components/button/text-button.css | 1 + .../resources/dotty_res/styles/theme/layout/header.css | 2 +- .../dotty/tools/scaladoc/renderers/HtmlRenderer.scala | 10 +++++----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scaladoc/resources/dotty_res/styles/theme/colors.css b/scaladoc/resources/dotty_res/styles/theme/colors.css index e6d34255cad0..57e426b65d47 100644 --- a/scaladoc/resources/dotty_res/styles/theme/colors.css +++ b/scaladoc/resources/dotty_res/styles/theme/colors.css @@ -176,7 +176,7 @@ --grey9: #706f78; --grey10: #7e7d86; --grey11: #a09fa6; - --grey12: #cccccc; + --grey12: #ededef; /* red colors */ --red1: #1f1315; diff --git a/scaladoc/resources/dotty_res/styles/theme/components/button/text-button.css b/scaladoc/resources/dotty_res/styles/theme/components/button/text-button.css index 739a14b0a76a..97c52807259b 100644 --- a/scaladoc/resources/dotty_res/styles/theme/components/button/text-button.css +++ b/scaladoc/resources/dotty_res/styles/theme/components/button/text-button.css @@ -84,6 +84,7 @@ a:active { text-decoration: none; margin-bottom: calc(1 * var(--base-spacing)); display: inline-block; + border-bottom: none; } .text-button.with-link::after { diff --git a/scaladoc/resources/dotty_res/styles/theme/layout/header.css b/scaladoc/resources/dotty_res/styles/theme/layout/header.css index aba2e5a4c27f..977d11a2cb17 100644 --- a/scaladoc/resources/dotty_res/styles/theme/layout/header.css +++ b/scaladoc/resources/dotty_res/styles/theme/layout/header.css @@ -5,7 +5,7 @@ flex-direction: row; justify-content: space-between; align-items: center; - padding: calc(1.75 * var(--base-spacing)) calc(3 * var(--base-spacing)); + padding: calc(2 * var(--base-spacing)) calc(3 * var(--base-spacing)); position: absolute; height: var(--header-height); left: 0px; diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala index 989d79729924..1a5912b4c94a 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala @@ -252,15 +252,15 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do div(id := "leftColumn", cls := "body-small")( Seq( div(cls:= "switcher-container")( - apiNavOpt match { - case Some(isApiActive, apiNav) => - Seq(a(id := "api-nav-button", cls:= s"switcher h100 ${if isApiActive then "selected" else ""}", href := pathToPage(link.dri, rootApiPage.get.link.dri))("API")) - case _ => Nil - }, docsNavOpt match { case Some(isDocsActive, docsNav) => Seq(a(id := "docs-nav-button", cls:= s"switcher h100 ${if isDocsActive then "selected" else ""}", href := pathToPage(link.dri, rootDocsPage.get.link.dri))("Docs")) case _ => Nil + }, + apiNavOpt match { + case Some(isApiActive, apiNav) => + Seq(a(id := "api-nav-button", cls:= s"switcher h100 ${if isApiActive then "selected" else ""}", href := pathToPage(link.dri, rootApiPage.get.link.dri))("API")) + case _ => Nil } ), apiNavOpt From fd84b312543bc82976ae2836d568b1199ec16c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=81ukasik?= Date: Tue, 5 Jul 2022 12:19:03 +0200 Subject: [PATCH 02/14] add missing code prop background, remove link border from toc, add proper width to toc, add missing divider above navigation arrows, --- docs/_layouts/static-site-main.html | 1 + .../dotty_res/styles/theme/components/code-snippet.css | 2 ++ .../dotty_res/styles/theme/components/table-of-content.css | 3 ++- scaladoc/resources/dotty_res/styles/theme/layout/content.css | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/_layouts/static-site-main.html b/docs/_layouts/static-site-main.html index 592ae0440e37..4b628ce8fd1f 100644 --- a/docs/_layouts/static-site-main.html +++ b/docs/_layouts/static-site-main.html @@ -12,6 +12,7 @@ page. {% endif %} {{ content }} +