Skip to content

Commit

Permalink
Added go-to-menu floating button to the static site
Browse files Browse the repository at this point in the history
  • Loading branch information
Anantachai Saothong (Manta) committed Sep 30, 2017
1 parent 6cd06fd commit c708b68
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/icon-menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,21 @@ label, input[type=checkbox] {
padding: 0;
}

#go-to-menu {
display: none;
position: fixed;
background: #D50000;
bottom: 28px;
right: 28px;
width: 56px;
height: 56px;
border-radius: 50%;
align-items: center;
justify-content: center;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
cursor: pointer;
}

@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (-webkit-min-device-pixel-ratio: 2) {
main {
padding-bottom: 2rem;
Expand All @@ -448,4 +463,8 @@ label, input[type=checkbox] {
display: block;
width: auto;
}

#go-to-menu {
display: flex;
}
}
16 changes: 15 additions & 1 deletion docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion edge/reviseDocumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function createFormattingDescription() {
'<code>' +
defaultOptionJSON
.replace(/<br>/g, '\n')
.replace(/^&nbsp;&nbsp;&quot;(\w+)&quot;/gm, (full, part) => full.replace(part, `<a href="#option-${_.kebabCase(part)}">${createBreakableWords('stylusSupremacy.' + part)}</a>`))
.replace(/^&nbsp;&nbsp;&quot;(\w+)&quot;/gm, (full, part) => full.replace(part, `<a href="#option-${_.kebabCase(part)}">stylusSupremacy.${createBreakableWords(part)}</a>`))
.replace(/\n/g, '<br>') +
'</code>'
)
Expand Down

0 comments on commit c708b68

Please sign in to comment.