Skip to content

Commit

Permalink
Merge pull request #2052 from balena-io/vipul/copy
Browse files Browse the repository at this point in the history
Add Copy to Clipboard button on code snippets
  • Loading branch information
bulldozer-balena[bot] authored Aug 26, 2021
2 parents 0a973be + 5501695 commit 91d728d
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 18 deletions.
85 changes: 67 additions & 18 deletions static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "tooltips.css";

body {
margin-top: 61px;
font-family: "Source Sans Pro", Arial, sans-serif;
Expand All @@ -15,7 +17,7 @@ body {
.content-wrapper {
min-height: 1371px;
background: white;
border-right: 1px solid #E7E9EC;
border-right: 1px solid #e7e9ec;
}

.page-content-wrapper {
Expand Down Expand Up @@ -170,16 +172,16 @@ article .headroom {
}

.sidebar .nav-menu .in-page-nav li.active a {
font-weight: bold;
color: #6b6d73;
font-weight: bold;
color: #6b6d73;
}

.sidebar .search-wrapper .algolia-wrapper {
border-bottom: 1px solid #e6e8eb;
border-right: 1px solid #e6e8eb;
padding: 10px;
padding-bottom: 9px;
background: #F7F7F7;
background: #f7f7f7;
}

.sidebar .search-wrapper .algolia-wrapper .algolia-autocomplete {
Expand Down Expand Up @@ -220,7 +222,9 @@ article .headroom {
color: #606060;
}

.page-content p, ul, ol {
.page-content p,
ul,
ol {
margin-top: 16px;
margin-bottom: 16px;
}
Expand Down Expand Up @@ -341,20 +345,24 @@ article .headroom {
}

.colorbox-img-wrappper {
outline: none!important;
outline: none !important;
}

.hash {
display: none;
}

h2:hover .hash, h3:hover .hash, h4:hover .hash, h5:hover .hash, h6:hover .hash {
h2:hover .hash,
h3:hover .hash,
h4:hover .hash,
h5:hover .hash,
h6:hover .hash {
display: inline-block;
}

.headroom {
top: 0;
transition: all .3s ease-in-out;
transition: all 0.3s ease-in-out;
}

.headroom--unpinned {
Expand All @@ -371,24 +379,24 @@ h2:hover .hash, h3:hover .hash, h4:hover .hash, h5:hover .hash, h6:hover .hash {
}

.sticky {
position: fixed!important;
top: 0!important;
box-shadow: 0px -1px 6px 0px rgba(194,194,194,1);
position: fixed !important;
top: 0 !important;
box-shadow: 0px -1px 6px 0px rgba(194, 194, 194, 1);
z-index: 100;
}

header.sticky {
box-shadow: 2px -1px 6px 0px rgba(194,194,194,1);
box-shadow: 2px -1px 6px 0px rgba(194, 194, 194, 1);
}

.btn-info {
background-color: #3C9DD0;
border-color: #3C9DD0;
background-color: #3c9dd0;
border-color: #3c9dd0;
border-radius: 3px;
}
.btn-info:hover {
background-color: #2F8CBD;
border-color: #2F8CBD;
background-color: #2f8cbd;
border-color: #2f8cbd;
}

.btn-primary {
Expand All @@ -402,7 +410,6 @@ header.sticky {
border-color: #ffffff;
}


/* dynamic-switch */
.dynamic-switch {
background: #23445e;
Expand Down Expand Up @@ -469,5 +476,47 @@ img.device_icon {
display: inline-block;
text-align: center;
margin: 0;
height: 1em
height: 1em;
}

/* "Copy" code block button */
pre {
position: relative;
}

.btnClipboard {
display: none;
}

pre .btnIcon {
position: absolute;
top: 14px;
z-index: 2;
cursor: pointer;
border: 1px solid transparent;
padding: 0;
color: #fff;
background-color: transparent;
height: 30px;
transition: all 0.25s ease-out;
}

pre:hover .btnClipboard {
display: block;
right: 15px;
background-color: #191b1c;
background-position: center center;
border-radius: 8px;
padding-left: 8px;
padding-top: 3px;
}

.btnIcon__body {
align-items: center;
display: flex;
}

.btnIcon svg {
fill: currentColor;
margin-right: 0.5em;
}
203 changes: 203 additions & 0 deletions static/css/tooltips.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 91d728d

Please sign in to comment.