Skip to content

Commit 8e8738c

Browse files
Shoe copy button only at code block hover
1 parent ea707ba commit 8e8738c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

assets/stylesheets/elements/_grid.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,21 @@ a.cta-secondary, [class^="language-"] button {
113113
}
114114
}
115115

116+
div.highlight {
117+
position: relative;
118+
119+
&:hover [class^="language-"] button {
120+
display: block;
121+
}
122+
}
123+
116124
[class^="language-"] button {
117125
cursor: pointer;
118126
padding: 0.1rem 0.4rem;
119-
margin-left: auto;
120127
font-size: 0.8rem;
128+
position: absolute;
129+
right: 0.4rem;
130+
top: 0.4rem;
131+
margin: 0;
132+
display: none;
121133
}

install/macos/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: Install Swift
1313
To download toolchains from Swift.org, use the Swiftly toolchain installer. Swift.org toolchains include experimental features like Embedded Swift and support for WebAssembly.
1414
</p>
1515
<h4>Run this in a terminal:</h4>
16-
<div class="language-plaintext highlighter-rouge"><button>Copy code</button><div class="highlight"><pre class="highlight"><code>curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg &amp;&amp; \
16+
<div class="language-plaintext highlighter-rouge"><div class="highlight"><button>Copy code</button><pre class="highlight"><code>curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg &amp;&amp; \
1717
installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory &amp;&amp; \
1818
~/usr/local/bin/swiftly init --quiet-shell-followup &amp;&amp; \
1919
. ~/Library/Application\ Support/swiftly/env.sh &amp;&amp; \

0 commit comments

Comments
 (0)