Skip to content

Commit 30f213c

Browse files
committed
place symbols on canvas to prevent them from being optimized away; change ID prefix; tweak layout of source toolbox
1 parent 7977d7a commit 30f213c

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

gulp.d/tasks/build.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ module.exports = (src, dest, preview) => () => {
114114
imagemin.optipng(),
115115
imagemin.svgo({
116116
plugins: [
117-
{ cleanupIDs: { preservePrefixes: ['icon-'] } },
118-
{ removeUselessDefs: false },
117+
{ cleanupIDs: { preservePrefixes: ['symbol-', 'view-'] } },
119118
{ removeViewBox: false },
120119
{ removeDesc: false },
121120
],

src/css/doc.css

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114

115115
.doc a:hover {
116116
color: var(--link_hover-font-color);
117-
/* -webkit-text-stroke-width: 0.01em; */
118117
}
119118

120119
.doc a.bare {
@@ -663,17 +662,14 @@
663662
position: relative;
664663
}
665664

666-
.doc .language-console .hljs-meta {
667-
user-select: none;
668-
}
669-
670665
.doc .source-toolbox {
671666
display: flex;
672667
visibility: hidden;
673668
position: absolute;
674669
top: 0.25rem;
675670
right: 0.5rem;
676671
color: var(--pre-annotation-font-color);
672+
font-family: var(--body-font-family);
677673
font-size: calc(13.5 / var(--rem-base) * 1rem);
678674
line-height: 1;
679675
}
@@ -684,11 +680,15 @@
684680

685681
.doc .source-toolbox .source-lang {
686682
text-transform: uppercase;
687-
line-height: 1.05;
683+
letter-spacing: 0.075em;
684+
font-size: 0.96em;
685+
line-height: 1.0425;
688686
}
689687

690688
.doc .source-toolbox > :not(:last-child)::after {
691-
content: " | ";
689+
content: "|";
690+
letter-spacing: 0;
691+
padding: 0 1ch;
692692
}
693693

694694
.doc .source-toolbox .copy-button {
@@ -702,8 +702,8 @@
702702
padding: 0;
703703
font-size: inherit;
704704
line-height: inherit;
705-
width: 1.1em;
706-
height: 1.1em;
705+
width: 1em;
706+
height: 1em;
707707
}
708708

709709
.source-toolbox .copy-button * {
@@ -725,7 +725,6 @@
725725
border-radius: 0.25em;
726726
padding: 0.5em;
727727
color: var(--color-white);
728-
font-family: var(--body-font-family);
729728
cursor: auto;
730729
opacity: 0;
731730
transition: opacity 0.5s ease 0.75s;
@@ -748,6 +747,10 @@
748747
transition: none;
749748
}
750749

750+
.doc .language-console .hljs-meta {
751+
user-select: none;
752+
}
753+
751754
.doc .hdlist1,
752755
.doc .hdlist2 {
753756
padding: 0;

src/img/octicons.svg

Lines changed: 6 additions & 2 deletions
Loading

src/js/06-copy-to-clipboard.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
3030
svg.setAttribute('aria-hidden', 'true')
3131
svg.setAttribute('class', 'copy-icon')
32-
svg.setAttribute('viewBox', '0 0 16 16')
3332
var use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
34-
use.setAttribute('href', window.uiRootPath + '/img/octicons.svg#icon-clippy-16')
33+
use.setAttribute('href', window.uiRootPath + '/img/octicons.svg#symbol-clippy-16')
3534
svg.appendChild(use)
3635
copy.appendChild(svg)
3736
;(toast = document.createElement('span')).className = 'copy-toast'

src/partials/header-content.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
--}}
8484
<a class="navbar-item" href="https://github.com/asciidoctor" target="_blank" rel="noopener">
8585
<span class="icon">
86-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><use href="{{{uiRootPath}}}/img/octicons.svg#icon-mark-github"></use></svg>
86+
<svg xmlns="http://www.w3.org/2000/svg"><use href="{{{uiRootPath}}}/img/octicons.svg#symbol-mark-github"></use></svg>
8787
</span>
8888
</a>
8989
</div>

0 commit comments

Comments
 (0)