aboutsummaryrefslogtreecommitdiff
path: root/_content/css/styles.css
diff options
context:
space:
mode:
authorFrederick Mixell <frederick.mixell@leftfieldlabs.com>2022-10-10 09:10:17 -0400
committerJamal Carvalho <jamal@golang.org>2022-12-05 14:51:44 +0000
commit6951227623e1c883fd12ef47e855d5f303503aef (patch)
tree7c2ca50da1595a20bc81eedeabb89aed9d97238f /_content/css/styles.css
parent05f06604c6df29052082c6f653ebb1a92666a06b (diff)
downloadgo-x-website-6951227623e1c883fd12ef47e855d5f303503aef.tar.xz
_content: Copy code snippets
- Updates pre style for doc articles - Adds js for copying code snippets - .CopyPaste class with button to work with the js Darkmode Screenshot: https://drive.google.com/file/d/1plTsw3rd_KoeNkjwEB19uOGZtr5DlHAT/view?usp=sharing Video: https://drive.google.com/file/d/1PuPiSVbKZsOSadW-iVYI-aNmiiXpPn8B/view?usp=sharing Change-Id: I2c244c6dd8e73b13c7ee8554d35919d0eb3e18c6 Reviewed-on: https://go-review.googlesource.com/c/website/+/441856 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to '_content/css/styles.css')
-rw-r--r--_content/css/styles.css31
1 files changed, 31 insertions, 0 deletions
diff --git a/_content/css/styles.css b/_content/css/styles.css
index cbb454fa..a0311efa 100644
--- a/_content/css/styles.css
+++ b/_content/css/styles.css
@@ -840,7 +840,38 @@ h1 + h2.subtitle {
background: var(--color-background-accented);
}
.Article pre {
+ padding: 0.5rem 1.75rem;
+ border-radius: 4px;
+}
+.CopyPaste {
+ display: flex;
+ align-items: center;
+ padding: 0.5rem 1.75rem;
+ border-radius: 4px;
+}
+.TabSection .CopyPaste {
+ margin-right: 2.5rem;
+}
+.CopyPaste button {
+ display: flex;
+ padding: unset;
+ background: none;
+ border: none;
+ margin-left: auto;
+ cursor: copy;
+}
+.CopyPaste button img.CopyPaste-icon {
margin-left: 1.5rem;
+ background-color: unset;
+}
+.CopyPaste .CopyPaste-icon-dark {
+ display: none;
+}
+[data-theme='dark'] .CopyPaste .CopyPaste-icon {
+ display: none;
+}
+[data-theme='dark'] .CopyPaste .CopyPaste-icon-dark {
+ display: block;
}
.Article.Doc img {
background-color: var(--white);