Skip to content

Commit 6141dfc

Browse files
committed
add style for documentableElement
1 parent b849736 commit 6141dfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+429
-26
lines changed

scaladoc-js/common/src/code-snippets/CodeSnippets.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import scala.util.chaining._
99

1010
import CodeSnippetsGlobals._
1111

12+
1213
class CodeSnippets:
1314
lazy val scastieConfig = getScastieConfiguration
1415

@@ -86,11 +87,14 @@ class CodeSnippets:
8687
}
8788

8889
private def copyRunButtons(snippet: html.Element) = {
90+
val copyButtonIcon = s"""<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
91+
<path d="M2.5 2.5V9.5H4V11H2C1.44772 11 1 10.5523 1 10V2C1 1.44772 1.44772 1 2 1H10C10.5523 1 11 1.44772 11 2V4H9.5V2.5H2.5Z" fill="#A09FA6"/>
92+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 6C5 5.44772 5.44772 5 6 5H14C14.5523 5 15 5.44772 15 6V14C15 14.5523 14.5523 15 14 15H6C5.44772 15 5 14.5523 5 14V6ZM6.5 13.5V6.5H13.5V13.5H6.5Z" fill="#A09FA6"/>
93+
</svg>
94+
"""
8995
def copyButton = {
9096
div(
91-
button(cls := "copy-button")(
92-
i(cls := "far fa-clone")
93-
).tap(_.addEventListener("click", _ => {
97+
button(cls := "copy-button icon-button").tap(_.addEventListener("click", _ => {
9498
val code = snippet.querySelectorAll("code>span:not(.hidden)")
9599
.map(_.textContent)
96100
.mkString
@@ -102,7 +106,6 @@ class CodeSnippets:
102106
val runButton = button(cls := "run-button")(
103107
i(cls := "fas fa-play")
104108
)
105-
106109
runButton.addEventListener("click", _ =>
107110
if !runButton.hasAttribute("opened") then {
108111
scastie.Embedded(snippet.querySelector("pre"), scastieConfig)
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)