From 5474214514c7878bee4f0c275aa2b24e9b17d7b8 Mon Sep 17 00:00:00 2001 From: zoobestik Date: Wed, 1 Feb 2023 01:41:37 +0100 Subject: [PATCH] Fix: sample spacing, blockquote, playground initialize --- .../dokka/scripts/platform-content-handler.js | 8 ++++++++ plugins/base/src/main/resources/dokka/styles/style.css | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js index 08915aa8c6e..0a7823518a3 100644 --- a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js +++ b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js @@ -305,6 +305,14 @@ function refreshFiltering() { refreshFilterButtons() refreshPlatformTabs() refreshNoContentNotification() + refreshPlaygroundSamples() +} + +function refreshPlaygroundSamples() { + document.querySelectorAll('code.runnablesample').forEach(node => { + const playground = node.KotlinPlayground; + playground && playground.view.codemirror.refresh(); + }); } function refreshNoContentNotification() { diff --git a/plugins/base/src/main/resources/dokka/styles/style.css b/plugins/base/src/main/resources/dokka/styles/style.css index 02003d4e60d..61d1a70ae9d 100644 --- a/plugins/base/src/main/resources/dokka/styles/style.css +++ b/plugins/base/src/main/resources/dokka/styles/style.css @@ -135,6 +135,11 @@ blockquote { color: var(--average-color); } +.theme-dark blockquote { + color: var(--default-font-color); + border-left-color: var(--code-background); +} + pre { display: block; } @@ -573,10 +578,13 @@ td:first-child { } .main-content p.paragraph, -.sample-container { +.sample-container, blockquote, +.content > .symbol { margin-top: 8px; } +blockquote, +.content > .symbol:first-of-type, p.paragraph:first-child, .brief p.paragraph { margin-top: 0;