diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2016-07-24 19:13:40 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2016-07-24 19:13:40 -0400 |
| commit | b1900d6ebcc39738885f90fa9f18b28206a74947 (patch) | |
| tree | 2d4975fe0a347af7101200c48e4a8df82ca780ae /mkdocs-material/src | |
| parent | 754ea372c66afad144988fcab2d7cf1fdbb3f2fc (diff) | |
very early checkin of template for user-docs, only a few pages filled out
Diffstat (limited to 'mkdocs-material/src')
42 files changed, 5258 insertions, 0 deletions
diff --git a/mkdocs-material/src/assets/fonts/icon.eot b/mkdocs-material/src/assets/fonts/icon.eot Binary files differnew file mode 100755 index 00000000..8f81638c --- /dev/null +++ b/mkdocs-material/src/assets/fonts/icon.eot diff --git a/mkdocs-material/src/assets/fonts/icon.json b/mkdocs-material/src/assets/fonts/icon.json new file mode 100644 index 00000000..fc26e570 --- /dev/null +++ b/mkdocs-material/src/assets/fonts/icon.json @@ -0,0 +1,348 @@ +{ + "IcoMoonType": "selection", + "icons": [ + { + "icon": { + "paths": [ + "M661.333 597.333h-33.92l-11.733-11.733c41.813-48.427 66.987-111.36 66.987-180.267 0-153.173-124.16-277.333-277.333-277.333s-277.333 124.16-277.333 277.333 124.16 277.333 277.333 277.333c68.907 0 131.84-25.173 180.267-66.773l11.733 11.733v33.707l213.333 212.907 63.573-63.573-212.907-213.333zM405.333 597.333c-106.027 0-192-85.973-192-192s85.973-192 192-192 192 85.973 192 192-85.973 192-192 192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "search" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 0, + "order": 7, + "prevSize": 24, + "code": 58880, + "name": "search" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 0 + }, + { + "icon": { + "paths": [ + "M853.333 469.333h-519.253l238.293-238.293-60.373-60.373-341.333 341.333 341.333 341.333 60.373-60.373-238.293-238.293h519.253v-85.333z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "arrow-back" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 1, + "order": 4, + "prevSize": 24, + "code": 58881, + "name": "arrow-back" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 1 + }, + { + "icon": { + "paths": [ + "M426.667 256l-60.373 60.373 195.627 195.627-195.627 195.627 60.373 60.373 256-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "chevron-right" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 2, + "order": 9, + "prevSize": 24, + "code": 58882, + "name": "chevron-right" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 2 + }, + { + "icon": { + "paths": [ + "M810.667 273.707l-60.373-60.373-238.293 238.293-238.293-238.293-60.373 60.373 238.293 238.293-238.293 238.293 60.373 60.373 238.293-238.293 238.293 238.293 60.373-60.373-238.293-238.293z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "close" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 3, + "order": 8, + "prevSize": 24, + "code": 58883, + "name": "close" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 3 + }, + { + "icon": { + "paths": [ + "M128 768h768v-85.333h-768v85.333zM128 554.667h768v-85.333h-768v85.333zM128 256v85.333h768v-85.333h-768z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "menu" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 4, + "order": 10, + "prevSize": 24, + "code": 58884, + "name": "menu" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 4 + }, + { + "icon": { + "paths": [ + "M512 170.667l-60.373 60.373 238.293 238.293h-519.253v85.333h519.253l-238.293 238.293 60.373 60.373 341.333-341.333z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "arrow-forward" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 5, + "order": 15, + "prevSize": 24, + "code": 58885, + "name": "arrow-forward" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 5 + }, + { + "icon": { + "paths": [ + "M1024 194.418c-37.676 16.708-78.164 28.002-120.66 33.080 43.372-26 76.686-67.17 92.372-116.23-40.596 24.078-85.556 41.56-133.41 50.98-38.32-40.83-92.922-66.34-153.346-66.34-116.022 0-210.088 94.058-210.088 210.078 0 16.466 1.858 32.5 5.44 47.878-174.6-8.764-329.402-92.4-433.018-219.506-18.084 31.028-28.446 67.116-28.446 105.618 0 72.888 37.088 137.192 93.46 174.866-34.438-1.092-66.832-10.542-95.154-26.278-0.020 0.876-0.020 1.756-0.020 2.642 0 101.788 72.418 186.696 168.522 206-17.626 4.8-36.188 7.372-55.348 7.372-13.538 0-26.698-1.32-39.528-3.772 26.736 83.46 104.32 144.206 196.252 145.896-71.9 56.35-162.486 89.934-260.916 89.934-16.958 0-33.68-0.994-50.116-2.94 92.972 59.61 203.402 94.394 322.042 94.394 386.422 0 597.736-320.124 597.736-597.744 0-9.108-0.206-18.168-0.61-27.18 41.056-29.62 76.672-66.62 104.836-108.748z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "twitter", + "brand", + "tweet", + "social" + ], + "defaultCode": 58525, + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 6, + "order": 9, + "prevSize": 24, + "code": 58886, + "ligatures": "twitter, brand11", + "name": "twitter" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 6 + }, + { + "icon": { + "paths": [ + "M810.667 384h-170.667v-256h-256v256h-170.667l298.667 298.667 298.667-298.667zM213.333 768v85.333h597.333v-85.333h-597.333z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "file-download" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 7, + "order": 10, + "prevSize": 24, + "code": 58888, + "name": "download" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 7 + }, + { + "icon": { + "paths": [ + "M512 736.853l263.68 159.147-69.973-299.947 232.96-201.813-306.773-26.027-119.893-282.88-119.893 282.88-306.773 26.027 232.96 201.813-69.973 299.947z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "star" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "id": 8, + "order": 9, + "prevSize": 24, + "code": 58889, + "name": "star" + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 8 + }, + { + "icon": { + "paths": [ + "M512.008 12.642c-282.738 0-512.008 229.218-512.008 511.998 0 226.214 146.704 418.132 350.136 485.836 25.586 4.738 34.992-11.11 34.992-24.632 0-12.204-0.48-52.542-0.696-95.324-142.448 30.976-172.504-60.41-172.504-60.41-23.282-59.176-56.848-74.916-56.848-74.916-46.452-31.778 3.51-31.124 3.51-31.124 51.4 3.61 78.476 52.766 78.476 52.766 45.672 78.27 119.776 55.64 149.004 42.558 4.588-33.086 17.852-55.68 32.506-68.464-113.73-12.942-233.276-56.85-233.276-253.032 0-55.898 20.004-101.574 52.76-137.428-5.316-12.9-22.854-64.972 4.952-135.5 0 0 43.006-13.752 140.84 52.49 40.836-11.348 84.636-17.036 128.154-17.234 43.502 0.198 87.336 5.886 128.256 17.234 97.734-66.244 140.656-52.49 140.656-52.49 27.872 70.528 10.35 122.6 5.036 135.5 32.82 35.856 52.694 81.532 52.694 137.428 0 196.654-119.778 239.95-233.79 252.624 18.364 15.89 34.724 47.046 34.724 94.812 0 68.508-0.596 123.644-0.596 140.508 0 13.628 9.222 29.594 35.172 24.566 203.322-67.776 349.842-259.626 349.842-485.768 0-282.78-229.234-511.998-511.992-511.998z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "github", + "brand", + "octacat", + "social" + ], + "grid": 24 + }, + "attrs": [], + "properties": { + "order": 27, + "prevSize": 24, + "ligatures": "github, brand40", + "name": "github", + "id": 9, + "code": 58887 + }, + "setIdx": 0, + "setId": 3, + "iconIdx": 9 + }, + { + "icon": { + "paths": [ + "M554 598v-172h-84v172h84zM554 768v-86h-84v86h84zM42 896l470-810 470 810h-940z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "warning" + ], + "defaultCode": 57346, + "grid": 24 + }, + "attrs": [], + "properties": { + "order": 11, + "prevSize": 24, + "name": "warning", + "ligatures": "warning", + "id": 2, + "code": 58896 + }, + "setIdx": 1, + "setId": 2, + "iconIdx": 2 + }, + { + "icon": { + "paths": [ + "M614 256h240v426h-300l-16-84h-240v298h-84v-726h384z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "flag" + ], + "defaultCode": 57683, + "grid": 24 + }, + "attrs": [], + "properties": { + "order": 13, + "prevSize": 24, + "name": "note", + "ligatures": "flag", + "id": 140, + "code": 58897 + }, + "setIdx": 1, + "setId": 2, + "iconIdx": 140 + } + ], + "height": 1024, + "metadata": { + "name": "icon" + }, + "preferences": { + "showGlyphs": true, + "showQuickUse": true, + "showQuickUse2": true, + "showSVGs": true, + "fontPref": { + "prefix": "icon-", + "metadata": { + "fontFamily": "icon", + "majorVersion": 1, + "minorVersion": 0 + }, + "metrics": { + "emSize": 1024, + "baseline": 6.25, + "whitespace": 50 + }, + "ie7": true, + "showSelector": true, + "selector": "class", + "classSelector": ".icon", + "showMetrics": true, + "showMetadata": true, + "cssVars": true, + "embed": false, + "noie8": false + }, + "imagePref": { + "prefix": "icon-", + "png": true, + "useClassSelector": true, + "color": 4473924, + "bgColor": 16777215 + }, + "historySize": 100, + "showCodes": true, + "gridSize": 16 + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/fonts/icon.svg b/mkdocs-material/src/assets/fonts/icon.svg new file mode 100755 index 00000000..86250e7b --- /dev/null +++ b/mkdocs-material/src/assets/fonts/icon.svg @@ -0,0 +1,22 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata>Generated by IcoMoon</metadata> +<defs> +<font id="icon" horiz-adv-x="1024"> +<font-face units-per-em="1024" ascent="960" descent="-64" /> +<missing-glyph horiz-adv-x="1024" /> +<glyph unicode=" " horiz-adv-x="512" d="" /> +<glyph unicode="" glyph-name="search" d="M661.333 341.334h-33.92l-11.733 11.733c41.813 48.427 66.987 111.36 66.987 180.267 0 153.173-124.16 277.333-277.333 277.333s-277.333-124.16-277.333-277.333 124.16-277.333 277.333-277.333c68.907 0 131.84 25.173 180.267 66.773l11.733-11.733v-33.707l213.333-212.907 63.573 63.573-212.907 213.333zM405.333 341.334c-106.027 0-192 85.973-192 192s85.973 192 192 192 192-85.973 192-192-85.973-192-192-192z" /> +<glyph unicode="" glyph-name="arrow-back" d="M853.333 469.334h-519.253l238.293 238.293-60.373 60.373-341.333-341.333 341.333-341.333 60.373 60.373-238.293 238.293h519.253v85.333z" /> +<glyph unicode="" glyph-name="chevron-right" d="M426.667 682.667l-60.373-60.373 195.627-195.627-195.627-195.627 60.373-60.373 256 256z" /> +<glyph unicode="" glyph-name="close" d="M810.667 664.96l-60.373 60.373-238.293-238.293-238.293 238.293-60.373-60.373 238.293-238.293-238.293-238.293 60.373-60.373 238.293 238.293 238.293-238.293 60.373 60.373-238.293 238.293z" /> +<glyph unicode="" glyph-name="menu" d="M128 170.667h768v85.333h-768v-85.333zM128 384h768v85.333h-768v-85.333zM128 682.667v-85.333h768v85.333h-768z" /> +<glyph unicode="" glyph-name="arrow-forward" d="M512 768l-60.373-60.373 238.293-238.293h-519.253v-85.333h519.253l-238.293-238.293 60.373-60.373 341.333 341.333z" /> +<glyph unicode="" glyph-name="twitter" d="M1024 744.249c-37.676-16.708-78.164-28.002-120.66-33.080 43.372 26 76.686 67.17 92.372 116.23-40.596-24.078-85.556-41.56-133.41-50.98-38.32 40.83-92.922 66.34-153.346 66.34-116.022 0-210.088-94.058-210.088-210.078 0-16.466 1.858-32.5 5.44-47.878-174.6 8.764-329.402 92.4-433.018 219.506-18.084-31.028-28.446-67.116-28.446-105.618 0-72.888 37.088-137.192 93.46-174.866-34.438 1.092-66.832 10.542-95.154 26.278-0.020-0.876-0.020-1.756-0.020-2.642 0-101.788 72.418-186.696 168.522-206-17.626-4.8-36.188-7.372-55.348-7.372-13.538 0-26.698 1.32-39.528 3.772 26.736-83.46 104.32-144.206 196.252-145.896-71.9-56.35-162.486-89.934-260.916-89.934-16.958 0-33.68 0.994-50.116 2.94 92.972-59.61 203.402-94.394 322.042-94.394 386.422 0 597.736 320.124 597.736 597.744 0 9.108-0.206 18.168-0.61 27.18 41.056 29.62 76.672 66.62 104.836 108.748z" /> +<glyph unicode="" glyph-name="github" d="M512.008 926.025c-282.738 0-512.008-229.218-512.008-511.998 0-226.214 146.704-418.132 350.136-485.836 25.586-4.738 34.992 11.11 34.992 24.632 0 12.204-0.48 52.542-0.696 95.324-142.448-30.976-172.504 60.41-172.504 60.41-23.282 59.176-56.848 74.916-56.848 74.916-46.452 31.778 3.51 31.124 3.51 31.124 51.4-3.61 78.476-52.766 78.476-52.766 45.672-78.27 119.776-55.64 149.004-42.558 4.588 33.086 17.852 55.68 32.506 68.464-113.73 12.942-233.276 56.85-233.276 253.032 0 55.898 20.004 101.574 52.76 137.428-5.316 12.9-22.854 64.972 4.952 135.5 0 0 43.006 13.752 140.84-52.49 40.836 11.348 84.636 17.036 128.154 17.234 43.502-0.198 87.336-5.886 128.256-17.234 97.734 66.244 140.656 52.49 140.656 52.49 27.872-70.528 10.35-122.6 5.036-135.5 32.82-35.856 52.694-81.532 52.694-137.428 0-196.654-119.778-239.95-233.79-252.624 18.364-15.89 34.724-47.046 34.724-94.812 0-68.508-0.596-123.644-0.596-140.508 0-13.628 9.222-29.594 35.172-24.566 203.322 67.776 349.842 259.626 349.842 485.768 0 282.78-229.234 511.998-511.992 511.998z" /> +<glyph unicode="" glyph-name="download" d="M810.667 554.667h-170.667v256h-256v-256h-170.667l298.667-298.667 298.667 298.667zM213.333 170.667v-85.333h597.333v85.333h-597.333z" /> +<glyph unicode="" glyph-name="star" d="M512 201.814l263.68-159.147-69.973 299.947 232.96 201.813-306.773 26.027-119.893 282.88-119.893-282.88-306.773-26.027 232.96-201.813-69.973-299.947z" /> +<glyph unicode="" glyph-name="warning" d="M554 340.667v172h-84v-172h84zM554 170.667v86h-84v-86h84zM42 42.667l470 810 470-810h-940z" /> +<glyph unicode="" glyph-name="hint" d="M614 682.667h240v-426h-300l-16 84h-240v-298h-84v726h384z" /> +</font></defs></svg>
\ No newline at end of file diff --git a/mkdocs-material/src/assets/fonts/icon.ttf b/mkdocs-material/src/assets/fonts/icon.ttf Binary files differnew file mode 100755 index 00000000..b5ab5601 --- /dev/null +++ b/mkdocs-material/src/assets/fonts/icon.ttf diff --git a/mkdocs-material/src/assets/fonts/icon.woff b/mkdocs-material/src/assets/fonts/icon.woff Binary files differnew file mode 100755 index 00000000..ed0f20d5 --- /dev/null +++ b/mkdocs-material/src/assets/fonts/icon.woff diff --git a/mkdocs-material/src/assets/images/favicon.ico b/mkdocs-material/src/assets/images/favicon.ico Binary files differnew file mode 100644 index 00000000..e85006a3 --- /dev/null +++ b/mkdocs-material/src/assets/images/favicon.ico diff --git a/mkdocs-material/src/assets/javascripts/application.js b/mkdocs-material/src/assets/javascripts/application.js new file mode 100644 index 00000000..d1ffbec3 --- /dev/null +++ b/mkdocs-material/src/assets/javascripts/application.js @@ -0,0 +1,530 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* Hey, there's your missing semicolon, lunr.js! */ +; + +/* Truncate a string after the given number of characters */ +String.prototype.truncate = function(n) { + if (this.length > n) { + while (this[n] != ' ' && --n > 0); + return this.substring(0, n) + '…'; + } + return this; +} + +/* Wrap an HTMLElement around each element in an HTMLElement array */ +HTMLElement.prototype.wrap = function (elms) { + if (!elms.length) elms = [elms]; + for (var i = elms.length - 1; i >= 0; i--) { + var child = (i > 0) ? this.cloneNode(true) : this; + var el = elms[i]; + + /* Cache current parent and sibling */ + var parent = el.parentNode, + sibling = el.nextSibling; + + /* Wrap the element and remove it from its current parent */ + child.appendChild(el); + if (sibling) { + parent.insertBefore(child, sibling); + } else { + parent.appendChild(child); + } + } +} + +/* ---------------------------------------------------------------------------- + * Application logic + * ------------------------------------------------------------------------- */ + +/* Initialize application upon DOM ready */ +document.addEventListener('DOMContentLoaded', function() { + 'use strict'; + + /* Test for iOS */ + Modernizr.addTest('ios', function() { + return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g); + }); + + /* Test for web application context */ + Modernizr.addTest('standalone', function() { + return !!navigator.standalone; + }); + + /* Attack FastClick to mitigate 300ms delay on touch devices */ + FastClick.attach(document.body); + + /* Grab relevant elements from the DOM */ + var toggle = document.getElementById('toggle-search'), + reset = document.getElementById('reset-search'), + drawer = document.querySelector('.drawer'), + anchors = document.querySelectorAll('.anchor'), + search = document.querySelector('.search .field'), + query = document.querySelector('.query'), + meta = document.querySelector('.results .meta'); + +/* ---------------------------------------------------------------------------- + * Initialize drawer + * ------------------------------------------------------------------------- */ + + /* Automatically close drawer when anchors are clicked */ + Array.prototype.forEach.call(anchors, function(item) { + item.querySelector('a').addEventListener('click', function() { + document.getElementById('toggle-drawer').checked = false; + document.body.classList.remove('toggle-drawer'); + }); + }); + + /* Align drawer to window offset */ + var pageYOffsetLast = window.pageYOffset; + var align = function() { + var boundary = window.pageYOffset + window.innerHeight; + var clipping = Math.max(0, window.innerHeight - drawer.offsetHeight); + + /* Ensure alignment with footer if at end of document */ + if (boundary > document.body.clientHeight - (96 - clipping)) { + if (drawer.style.position != 'absolute') { + drawer.style.position = 'absolute'; + drawer.style.top = null; + drawer.style.bottom = 0; + } + + /* Pin drawer to top, if window is higher than drawer */ + } else if (drawer.offsetHeight < window.innerHeight) { + if (drawer.style.position != 'fixed') { + drawer.style.position = 'fixed'; + drawer.style.top = 0; + drawer.style.bottom = null; + } + + /* If the drawer is not pinned, check if we need to pin it */ + } else if (drawer.style.position != 'fixed') { + + /* Pin drawer to bottom of window */ + if (boundary > drawer.offsetTop + drawer.offsetHeight) { + drawer.style.position = 'fixed'; + drawer.style.top = null; + drawer.style.bottom = -96 + 'px'; + + /* Pin drawer to top of window */ + } else if (window.pageYOffset < drawer.offsetTop) { + drawer.style.position = 'fixed'; + drawer.style.top = 0; + drawer.style.bottom = null; + } + + /* If the drawer is pinned, check if we have to unpin it */ + } else { + if (window.pageYOffset > pageYOffsetLast) { + if (drawer.style.top) { + drawer.style.position = 'absolute'; + drawer.style.top = Math.max(0, pageYOffsetLast) + 'px'; + drawer.style.bottom = null; + } + } else if (drawer.style.bottom) { + drawer.style.position = 'absolute'; + drawer.style.top = (boundary - drawer.offsetHeight) + 'px'; + drawer.style.bottom = null; + } + } + + /* Update last offset (mitigiate negative offsets in Safari) */ + pageYOffsetLast = Math.max(0, window.pageYOffset); + } + + /* Check for media query events */ + var check = function() { + var main = document.querySelector('.main'); + window.removeEventListener('scroll', align); + + /* Reset drawer position when entering collapsed mode */ + if (matchMedia("only screen and (max-width: 959px)").matches) { + drawer.style.position = null; + drawer.style.top = null; + drawer.style.bottom = null; + + /* Check if the scroll handler needs to be registered */ + } else if (drawer.offsetHeight + 96 < main.offsetHeight) { + window.addEventListener('scroll', align); + align(); + } + } + + /* Register resize handler and fire once */ + if (!Modernizr.ios) { + window.addEventListener('resize', check); + check(); + } + +/* ---------------------------------------------------------------------------- + * Initialize search index + * ------------------------------------------------------------------------- */ + + /* Initialize index */ + var initialize = function() { + pegasus(base_url + '/mkdocs/search_index.json').then( + + /* Request successful, we got the index */ + function(data, xhr) { + + /* Create index */ + var index = lunr(function() { + this.field('title', { boost: 10 }); + this.field('text'); + this.ref('location'); + }); + + /* Index articles */ + var articles = {}; + data.docs.map(function(article) { + article.location = base_url + article.location; + articles[article.location] = article; + index.add(article); + }); + + /* Register keyhandler to execute search on key up */ + query.addEventListener('keyup', function() { + var container = document.querySelector('.results .list'); + while (container.firstChild) + container.removeChild(container.firstChild); + + /* Abort, if the query is empty */ + var bar = document.querySelector('.bar.search'); + if (!query.value.length) { + while (meta.firstChild) + meta.removeChild(meta.firstChild); + + /* Restore state */ + bar.classList.remove('non-empty'); + return; + } + + /* Show reset button */ + bar.classList.add('non-empty'); + + /* Execute search */ + var results = index.search(query.value); + results.map(function(result) { + var article = articles[result.ref]; + + /* Create article container */ + var teaser = document.createElement('article'); + teaser.classList.add('result'); + + /* Create title element */ + var title = document.createElement('h1'); + title.innerHTML = article.title; + teaser.appendChild(title); + + // /* Create text element */ + // var text = document.createElement('p'); + // text.innerHTML = article.text.truncate(140); + // teaser.appendChild(text); + + /* Create a link referring to the article */ + var link = document.createElement('a'); + link.href = article.location; + link.appendChild(teaser); + + /* Create url element */ + var url = document.createElement('span'); + url.innerHTML = link.href.split('#')[0]; + teaser.appendChild(url); + + /* Close search and jump to anchor when on same page */ + var parts = link.href.split('#'); + if (parts[0] == document.location.href.split('#')[0]) { + link.addEventListener('click', function(e) { + document.body.classList.remove('toggle-search'); + document.body.classList.remove('locked'); + toggle.checked = false; + + /* Don't catch anchors if the search doesn't cover the page */ + if (matchMedia('only screen and (min-width: 960px)').matches) + return; + + /* Prevent default to intercept scroll-to behaviour and + stop propagation, as this interferes with the link-lock in + the web application context, which opens all internal links + inside the same context */ + e.preventDefault(); + e.stopPropagation(); + + /* Scroll to chapter, if given */ + if (parts.length != 1) { + var chapter = document.getElementById(parts[1]); + if (chapter) { + + /* Scroll to chapter, but wait for 100ms to prevent flashes + on iOS. A short timeout seems to do the trick */ + setTimeout(function() { + chapter.scrollIntoView && chapter.scrollIntoView() || + window.scrollTo(0, chapter.offsetTop); + }, 100); + } + } + }); + } + + /* Add article to search results */ + container.appendChild(link); + }); + + /* Show number of search results */ + var number = document.createElement('strong'); + number.innerHTML = results.length + ' search result' + + (results.length != 1 ? 's' : ''); + + /* Update number */ + while (meta.firstChild) + meta.removeChild(meta.firstChild); + meta.appendChild(number); + }); + }, + + /* Handle error */ + function(data, xhr) { + console.error(data, xhr.status); + } + ); + + /* Remove listener, as we only have to initialize once */ + toggle.removeEventListener('click', initialize); + }; + + /* Initialize on first click */ + toggle.addEventListener('click', initialize); + +/* ---------------------------------------------------------------------------- + * Initialize search modal + * ------------------------------------------------------------------------- */ + + /* Intercept click on search mode toggle */ + var offset = 0; + toggle.addEventListener('click', function(e) { + var list = document.body.classList; + var lock = !matchMedia('only screen and (min-width: 960px)').matches; + + /* Exiting search mode */ + if (list.contains('locked')) { + list.remove('locked'); + + /* Scroll to former position, but wait for 100ms to prevent flashes + on iOS. A short timeout seems to do the trick */ + if (lock) + setTimeout(function() { + window.scrollTo(0, offset); + }, 100); + + /* Entering search mode */ + } else { + offset = window.scrollY; + + /* First timeout: scroll to top after transition, to omit flickering */ + if (lock) + setTimeout(function(){ + window.scrollTo(0, 0); + }, 400); + + /* Second timeout: Lock body after finishing transition and scrolling to + top and focus input field. Sadly, the focus event is not dispatched + on iOS Safari and there's nothing we can do about it. */ + setTimeout(function() { + + /* This additional check is necessary to handle fast subsequent clicks + on the toggle and the timeout to lock the body must be cancelled */ + if (this.checked) { + if (lock) + list.add('locked'); + setTimeout(function() { + query.focus(); + }, 200); + } + }.bind(this), 450); + } + }); + + /* Dispatch input focus on touch of search section */ + search.addEventListener('touchstart', function() { + query.focus(); + }); + + /* Exit search mode when pressing ESC */ + window.addEventListener('keyup', function(e) { + var code = e.keyCode || e.which; + if (code == 27) { + query.blur(); + + /* Exit locked state */ + document.body.classList.remove('toggle-search'); + document.body.classList.remove('locked'); + toggle.checked = false; + } + }); + + /* Delete search results upon click on "x" */ + var empty = document.getElementById('reset-search'); + empty.addEventListener('click', function() { + var container = document.querySelector('.results .list'); + while (container.firstChild) + container.removeChild(container.firstChild); + + /* Hide search button */ + var bar = document.querySelector('.bar.search'); + bar.classList.remove('non-empty'); + + /* Reset number of search results */ + meta.innerHTML = ''; + + /* Empty search input */ + query.value = ''; + query.focus(); + }); + +/* ---------------------------------------------------------------------------- + * Initialize scroll spy + * ------------------------------------------------------------------------- */ + + /* Retrieve vertical offset of article chapters */ + var chapters = document.querySelectorAll('h2'); + chapters = Array.prototype.map.call(chapters, function(item) { + return item.offsetTop; + }); + + /* Update currently active chapter, if the new chapter is two thirds + into the viewport - account for iOS web application context */ + var visible = null; + document.addEventListener('scroll', function() { + var offset = window.scrollY + (window.innerHeight / 3), + active = chapters.length - 1; + for (var c = 0; c < active; c++) + if (offset < chapters[c + 1]) + active = c; + + /* Update anchors, if a new chapter became visible */ + if (active != visible) { + visible = active; + Array.prototype.forEach.call(anchors, function(item, index) { + var link = item.querySelector('a'); + if (index != visible || link.classList.add('current')) + link.classList.remove('current'); + }); + } + }); + +/* ---------------------------------------------------------------------------- + * Fix syntax highlighting + * ------------------------------------------------------------------------- */ + + /* Fix highlighting for function calls */ + var functions = document.querySelectorAll('.n + .p'); + Array.prototype.forEach.call(functions, function(item) { + var text = item.innerText || item.textContent; + if (text && text[0] == '(') + item.previousSibling.classList.add('f'); + }); + +/* ---------------------------------------------------------------------------- + * Progressive structure enhancement + * ------------------------------------------------------------------------- */ + + /* Wrap all data tables */ + var tables = document.querySelectorAll('table'); + Array.prototype.forEach.call(tables, function(item) { + var wrapper = document.createElement('div'); + wrapper.classList.add('data'); + wrapper.wrap(item); + }); + +/* ---------------------------------------------------------------------------- + * Fix overflow scrolling on iOS + * ------------------------------------------------------------------------- */ + + /* Force 1px scroll offset to trigger overflow scrolling */ + if (Modernizr.ios) { + var scrollable = document.querySelectorAll( + '.scrollable, .standalone .article'); + Array.prototype.forEach.call(scrollable, function(item) { + item.addEventListener('touchstart', function() { + var top = this.scrollTop; + + /* We're at the top of the container */ + if (top == 0) { + this.scrollTop = 1; + + /* We're at the bottom of the container */ + } else if (top + this.offsetHeight == this.scrollHeight) { + this.scrollTop = top - 1; + } + }); + }); + } + + /* Prevent scrolling on project, overlay and header */ + var prevented = document.querySelectorAll('.project, .overlay, .header'); + Array.prototype.forEach.call(prevented, function(item) { + item.addEventListener('touchmove', function(e) { + e.preventDefault(); + }); + }); + +/* ---------------------------------------------------------------------------- + * Fallback for browsers that don't support :checked + * ------------------------------------------------------------------------- */ + + /* Set representative class on body for active toggle */ + var toggles = document.querySelectorAll('.toggle'); + Array.prototype.forEach.call(toggles, function(item) { + item.addEventListener('click', function() { + document.body.classList.toggle(this.id); + }); + }); + +/* ---------------------------------------------------------------------------- + * Initialize GitHub star button + * ------------------------------------------------------------------------- */ + + /* Get Stars for current repository */ + if (repo_id) { + pegasus('https://api.github.com/repos/' + repo_id).then( + + /* Request successful, we got the stars */ + function(data, xhr) { + var count = data.stargazers_count; + if (count > 10000) + count = (count / 1000).toFixed(0) + 'k'; + else if (count > 1000) + count = (count / 1000).toFixed(1) + 'k'; + + /* Set number of stars */ + var stars = document.querySelector('.repo-stars .count'); + stars.innerHTML = count; + }, + + /* Handle error */ + function(data, xhr) { + console.error(data, xhr.status); + } + ); + } +});
\ No newline at end of file diff --git a/mkdocs-material/src/assets/javascripts/standalone.js b/mkdocs-material/src/assets/javascripts/standalone.js new file mode 100644 index 00000000..0ed04487 --- /dev/null +++ b/mkdocs-material/src/assets/javascripts/standalone.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Taken and adapted from https://gist.github.com/kylebarrow/1042026 + * ------------------------------------------------------------------------- */ + +/* Detect standalone mode */ +if (('standalone' in window.navigator) && window.navigator.standalone) { + + /* If you want to prevent remote links in standalone web apps opening + Mobile Safari, change 'remotes' to true */ + var node, remotes = false; + + /* Bind to document */ + document.addEventListener('click', function(event) { + node = event.target; + + /* Bubble up until we hit link or top HTML element. Warning: BODY element + is not compulsory so better to stop on HTML */ + while (node.nodeName !== 'A' && node.nodeName !== 'HTML') { + node = node.parentNode; + } + if ('href' in node && node.href.indexOf('http') !== -1 && ( + node.href.indexOf(document.location.host) !== -1 || remotes)) { + event.preventDefault(); + document.location.href = node.href; + } + }, false); +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/_highlight.scss b/mkdocs-material/src/assets/stylesheets/_highlight.scss new file mode 100644 index 00000000..9882d794 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/_highlight.scss @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Code highlighter + * ------------------------------------------------------------------------- */ + +/* + * Code block + */ +pre { + background: rgba($black, 0.05); + + /* + * Ensure correct color + */ + &, code { + color: $black; + } +} + +/* + * Operators and comments + */ +.o, .c, .c1, .cm { + color: $black-light; +} + +/* + * Keywords + */ +.k, .kn { + color: #A71D5D; +} + +/* + * Types and functions + */ +.kt, .kd { + color: #0086B3; +} + +/* + * Function definition + */ +.nf, .n.f { + color: #795da3; +} + +/* + * Classes + */ +.nx { + color: #0086b3; +} + +/* + * Strings + */ +.s, .s1 { + color: #183691; +} + +/* + * Constants and numbers + */ +.mi, .bp { + color: #9575CD; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/_palette.scss b/mkdocs-material/src/assets/stylesheets/_palette.scss new file mode 100644 index 00000000..3629d28a --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/_palette.scss @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Palette + * ------------------------------------------------------------------------- */ + +/* + * Primary and accent color + */ +$primary: $red-400 !default; +$accent: $teal-a700 !default; + +/* + * Black opacities + */ +$black: rgba(black, 0.87); +$black-light: rgba(black, 0.54); +$black-lighter: rgba(black, 0.26); +$black-lightest: rgba(black, 0.12); + +/* + * White opacities + */ +$white: rgba(white, 1.00); +$white-light: rgba(white, 0.70); +$white-lighter: rgba(white, 0.30); +$white-lightest: rgba(white, 0.12);
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/_print.scss b/mkdocs-material/src/assets/stylesheets/_print.scss new file mode 100644 index 00000000..1b29b8b1 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/_print.scss @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Print overrides + * ------------------------------------------------------------------------- */ + +/* + * Print styles + */ +@media print { + + /* + * Hide non-relevant elements + */ + .header, .drawer, .headerlink, .footer { + display: none; + } + + /* + * Article + */ + .article { + + /* + * Remove top spacing + */ + .wrapper { + padding-top: 0; + } + + /* + * Remove color in all code blocks + */ + pre, pre * { + color: $black !important; + } + + pre { + border: 1px solid $black-lightest; + } + + /* + * Border-radius makes this table entirely black on paper, so scrap it + */ + table { + border-radius: none; + box-shadow: none; + + /* + * Color header + */ + th { + color: $primary; + } + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/_reset.scss b/mkdocs-material/src/assets/stylesheets/_reset.scss new file mode 100644 index 00000000..57bfb1a6 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/_reset.scss @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Resets + * ------------------------------------------------------------------------- */ + +/* + * Enfore correct box model - the prefixed versions are necessary for older + * browsers, i.e. Chrome < 10, Firefox < 29, Safari < 6 and Android < 4 + */ +html { + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +/* + * All elements shall inherit the document default + */ +*, *:before, *:after { + box-sizing: inherit; + -moz-box-sizing: inherit; + -webkit-box-sizing: inherit; +} + +/* + * 16px --> 10px, browser default + */ +html { + font-size: 62.5%; + text-size-adjust: none; +} + +/* + * Reset spacing and borders for all tags + */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, main, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; +} + +/* + * Enforce correct rendering of main element - missing in user agent stylesheet + * of IE11 on Windows 7. + */ +main { + display: block; +} + +/* + * Reset list styles + */ +ul { + list-style: none; +} + +/* + * Reset table styles + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* + * Reset table cell styles + */ +td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} + +/* + * Reset (native) button styles + */ +button { + outline: 0; + padding: 0; + + background: transparent; + border: none; + + font-size: inherit; +} + +/* + * Reset (native) input styles + */ +input { + @include appearance(none); + + outline: none; + border: none; +} + +/* + * Reset link styles + */ +a { + text-decoration: none; + color: inherit; +} + +/* + * Reset tap outlines on iOS and Android + */ +a, button, label, input { + -webkit-tap-highlight-color: rgba(white, 0); + -webkit-tap-highlight-color: transparent; +} + +/* + * Reset headlines + */ +h1, h2, h3, h4, h5, h6 { + font-weight: inherit; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/_shame.scss b/mkdocs-material/src/assets/stylesheets/_shame.scss new file mode 100644 index 00000000..cd2b1573 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/_shame.scss @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Nothing to see here, move along + * ------------------------------------------------------------------------- */
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/application.scss b/mkdocs-material/src/assets/stylesheets/application.scss new file mode 100644 index 00000000..dc02b3c0 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/application.scss @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Dependencies + * ------------------------------------------------------------------------- */ + +@import "bourbon"; +@import "quantum-colors"; +@import "quantum-shadows"; + +/* ---------------------------------------------------------------------------- + * Application + * ------------------------------------------------------------------------- */ + +@import "reset"; +@import "palette"; +@import "highlight"; + +@import "fonts/icon"; + +@import "mixins/break"; + +@import "modules/base"; +@import "modules/drawer"; +@import "modules/article"; +@import "modules/search"; + +@import "print"; +@import "shame";
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/fonts/_icon.scss b/mkdocs-material/src/assets/stylesheets/fonts/_icon.scss new file mode 100644 index 00000000..e66951d9 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/fonts/_icon.scss @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Font faces - defined in base.html for correct path resolution + * ------------------------------------------------------------------------- */ + +// /* +// * Icon font +// */ +// @font-face { +// font-family: 'Icon'; +// src: url('/assets/fonts/icon.eot?52m981'); +// src: url('/assets/fonts/icon.eot?#iefix52m981') format('embedded-opentype'), +// url('/assets/fonts/icon.woff?52m981') format('woff'), +// url('/assets/fonts/icon.ttf?52m981') format('truetype'), +// url('/assets/fonts/icon.svg?52m981#icon') format('svg'); +// font-weight: normal; +// font-style: normal; +// } + +/* ---------------------------------------------------------------------------- + * Representational classes + * ------------------------------------------------------------------------- */ + +/* + * Base icon class + */ +.icon { + font-family: 'Icon'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* + * Magnifying glass + */ +.icon-search:before { + content: "\e600"; +} + +/* + * Back arrow + */ +.icon-back:before { + content: "\e601"; +} + +/* + * Link indicator + */ +.icon-link:before { + content: "\e602"; +} + +/* + * Close button + */ +.icon-close:before { + content: "\e603"; +} + +/* + * Hamburger icon + */ +.icon-menu:before { + content: "\e604"; +} + +/* + * Forward arrow + */ +.icon-forward:before { + content: "\e605"; +} + +/* + * Twitter icon + */ +.icon-twitter:before { + content: "\e606"; +} + +/* + * GitHub icon + */ +.icon-github:before { + content: "\e607"; +} + +/* + * Download icon + */ +.icon-download:before { + content: "\e608"; +} + +/* + * Star icon + */ +.icon-star:before { + content: "\e609"; +} + +/* + * Warning icon + */ +.icon-warning:before { + content: "\e610"; +} + +/* + * Star icon + */ +.icon-note:before { + content: "\e611"; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/mixins/_break.scss b/mkdocs-material/src/assets/stylesheets/mixins/_break.scss new file mode 100644 index 00000000..468fa2ec --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/mixins/_break.scss @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Defaults + * ------------------------------------------------------------------------- */ + +$break: ( + devices: ( + mobile: ( + portrait: 220px 479px, + landscape: 480px 719px + ), + tablet: ( + portrait: 720px 959px, + landscape: 960px 1199px + ), + screen: 1200px + ) +) !default; + +/* ---------------------------------------------------------------------------- + * Helper functions + * ------------------------------------------------------------------------- */ + +/* + * Choose minimum and maximum device widths. + */ +@function break-select-min-max($devices) { + $min: 1000000; $max: 0; + @each $key, $value in $devices { + @while type-of($value) == map { + $value: break-select-min-max($value); + } + @if type-of($value) == list { + @each $number in $value { + @if type-of($number) == number { + $min: min($number, $min); + @if $max != null { + $max: max($number, $max); + } + } @else { + @warn "Invalid number: #{$number}"; + } + } + } @elseif type-of($value) == number { + $min: min($value, $min); + $max: null; + } @else { + @warn "Invalid tuple: #{$value}"; + } + } + @return $min, $max; +} + +/* + * Select minimum and maximum widths for a device breakpoint. + */ +@function break-select-device($device) { + $devices: map-get($break, devices); + @for $n from 1 through length($device) { + @if type-of($devices) == map { + $devices: map-get($devices, nth($device, $n)); + } @else { + @warn "Invalid device map: #{$devices}"; + } + } + @if type-of($devices) == list or + type-of($devices) == number { + $devices: (default: $devices); + } + @return break-select-min-max($devices); +} + +/* ---------------------------------------------------------------------------- + * Mixins for numeric breakpoints + * ------------------------------------------------------------------------- */ + +/* + * A minimum-maximum media query breakpoint. + */ +@mixin break-at($breakpoint) { + @if type-of($breakpoint) == number { + @media only screen and (min-width: $breakpoint) { + @content; + } + } @elseif type-of($breakpoint) == list { + $min: nth($breakpoint, 1); $max: nth($breakpoint, 2); + @if type-of($min) == number and type-of($max) == number { + @media only screen and (min-width: $min) and (max-width: $max) { + @content; + } + } @else { + @warn "Invalid breakpoint: #{$breakpoint}"; + } + } @else { + @warn "Invalid breakpoint: #{$breakpoint}"; + } +} + +/* + * An orientation media query breakpoint. + */ +@mixin break-at-orientation($breakpoint) { + @if type-of($breakpoint) == string { + @media only screen and (orientation: $breakpoint) { + @content; + } + } @else { + @warn "Invalid breakpoint: #{$breakpoint}"; + } +} + +/* + * A maximum-aspect-ratio media query breakpoint. + */ +@mixin break-at-ratio($breakpoint) { + @if type-of($breakpoint) == number { + @media only screen and (max-aspect-ratio: $breakpoint) { + @content; + } + } @else { + @warn "Invalid breakpoint: #{$breakpoint}"; + } +} + +/* ---------------------------------------------------------------------------- + * Mixins for device breakpoints + * ------------------------------------------------------------------------- */ + +/* + * A minimum-maximum media query device breakpoint. + */ +@mixin break-at-device($device) { + @if type-of($device) == string { + $device: $device,; + } + @if type-of($device) == list { + $breakpoint: break-select-device($device); + @if nth($breakpoint, 2) != null { + $min: nth($breakpoint, 1); $max: nth($breakpoint, 2); + @media only screen and (min-width: $min) and (max-width: $max) { + @content; + } + } @else { + @warn "Invalid device: #{$device}"; + } + } @else { + @warn "Invalid device: #{$device}"; + } +} + +/* + * A minimum media query device breakpoint. + */ +@mixin break-from-device($device) { + @if type-of($device) == string { + $device: $device,; + } + @if type-of($device) == list { + $breakpoint: break-select-device($device); + $min: nth($breakpoint, 1); + @media only screen and (min-width: $min) { + @content; + } + } @else { + @warn "Invalid device: #{$device}"; + } +} + +/* + * A maximum media query device breakpoint. + */ +@mixin break-to-device($device) { + @if type-of($device) == string { + $device: $device,; + } + @if type-of($device) == list { + $breakpoint: break-select-device($device); + $max: nth($breakpoint, 1) - 1; + @media only screen and (max-width: $max) { + @content; + } + } @else { + @warn "Invalid device: #{$device}"; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/_article.scss b/mkdocs-material/src/assets/stylesheets/modules/_article.scss new file mode 100644 index 00000000..0529e777 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/_article.scss @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +@import "article/animation"; +@import "article/appearance"; +@import "article/layout"; +@import "article/typography";
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/_base.scss b/mkdocs-material/src/assets/stylesheets/modules/_base.scss new file mode 100644 index 00000000..140d308f --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/_base.scss @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +@import "base/animation"; +@import "base/appearance"; +@import "base/layout"; +@import "base/typography";
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/_drawer.scss b/mkdocs-material/src/assets/stylesheets/modules/_drawer.scss new file mode 100644 index 00000000..afefecff --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/_drawer.scss @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +@import "drawer/animation"; +@import "drawer/appearance"; +@import "drawer/layout"; +@import "drawer/typography";
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/_search.scss b/mkdocs-material/src/assets/stylesheets/modules/_search.scss new file mode 100644 index 00000000..77914e3b --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/_search.scss @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +@import "search/animation"; +@import "search/appearance"; +@import "search/layout"; +@import "search/typography";
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/article/_animation.scss b/mkdocs-material/src/assets/stylesheets/modules/article/_animation.scss new file mode 100644 index 00000000..4a3cfb10 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/article/_animation.scss @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Article animation + * ------------------------------------------------------------------------- */ + +/* + * Fade color after highlighting + */ +pre span { + transition: color .25s; +} + +/* + * Copyright and theme information + */ +.copyright { + + /* + * Animate color on hover + */ + a { + transition: color .25s; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/article/_appearance.scss b/mkdocs-material/src/assets/stylesheets/modules/article/_appearance.scss new file mode 100644 index 00000000..f02f84e4 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/article/_appearance.scss @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Article appearance + * ------------------------------------------------------------------------- */ + +/* + * Article + */ +.article { + + /* + * Differing top and bottom rubberband backgrounds in iOS web application + */ + .ios.standalone & { + background: linear-gradient( + to bottom, $white 50%, $primary 50%); + + /* Hack [iOS]: Mitigate black bounding box with linear gradient */ + .wrapper { + background: linear-gradient( + to bottom, $white 50%, $white 50%); + } + } + + /* + * Headlines, chapters, links and inline code + */ + h1, h2, a { + color: $primary; + } + + /* + * Inline code + */ + code { + background: #eee; + } + + /* + * Keyboard tags + */ + kbd { + color: #555; + background-color: #fcfcfc; + border: solid 1px #ccc; + border-bottom-color: #bbb; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #bbb; + } + + /* + * Lower border for main headline + */ + h1 { + border-bottom: 1px solid $black-lightest; + } + + /* + * Underline links + */ + a { + border-bottom: 1px dotted; + } + + /* + * Hovered and focused links + */ + a:hover, a:focus { + color: $accent; + } + + /* + * Light permalinks + */ + .headerlink { + color: $black-lighter; + border: none; + } + + /* + * Data tables + */ + table { + @include drop-shadow(1); + + border-radius: 3px; + + /* + * Table heading + */ + th { + background: mix($primary, $white, 75%); + color: $white; + } + + /* + * Table cell + */ + td { + border-top: 1px solid rgba($black, 0.05); + } + } + + /* + * Blockquote styles + */ + blockquote { + border-left: 2px solid $black-light; + color: $black-light; + } +} + +/* + * Article footer + */ +.footer { + background: $primary; + color: $white; + + /* + * Remove bottom border on links + */ + a { + border: none; + } +} + +/* + * Copyright and theme information + */ +.copyright { + color: $black-light; +} + +/* + * Pagination + */ +.pagination { + + /* + * Inherit color for links + */ + a .title, a .button { + color: $white; + } + + /* + * Smaller font size for direction + */ + .direction { + color: $white-light; + } +} + +/* + * Admonition support + */ +.admonition { + background: $light-blue-400; + color: $white; + + /* + * Embedded code blocks + */ + pre { + background: $white-lighter; + } + + /* + * A warning hint + */ + &.warning { + background: $red-400; + } + + /* + * Headlines, chapters, links and inline code + */ + a, a:hover { + color: $white; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/article/_layout.scss b/mkdocs-material/src/assets/stylesheets/modules/article/_layout.scss new file mode 100644 index 00000000..c5605160 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/article/_layout.scss @@ -0,0 +1,585 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Article layout + * ------------------------------------------------------------------------- */ + +/* + * Article + */ +.article { + font-size: 14px; + line-height: 1.7em; + + /* [tablet landscape+]: Indent to account for drawer */ + @include break-from-device(tablet landscape) { + margin-left: 262px; + } + + /* + * Clearfix + */ + &:after { + content: " "; + display: block; + clear: both; + } + + /* + * Article wrapper + */ + .wrapper { + padding: 116px 16px 92px; + + /* [tablet portait+]: Increase top spacing */ + @include break-from-device(tablet portrait) { + padding: 128px 24px 96px; + } + } + + /* + * Enable overflow scrolling in iOS web application + */ + .ios.standalone & { + @include position(absolute, 56px 0 0 0); + + overflow: auto; + -webkit-overflow-scrolling: touch; + + /* [orientation: portrait]: Account for status bar in portrait mode */ + @include break-at-orientation(portrait) { + @include position(absolute, (56px + 20px) 0 0 0); + } + + /* + * Article wrapper + */ + .wrapper { + position: relative; + min-height: 100%; + padding-top: 60px; + margin-bottom: 2px; + } + } + + /* + * Article headline + */ + h1 { + font-size: 24px; + line-height: 1.333334em; + padding: 20px 0 42px; + } + + /* + * Article chapters + */ + h2 { + font-size: 20px; + line-height: 1.4em; + padding-top: (36px + 56px); + margin-top: (0px - 56px); + + /* + * No offset correction in iOS web application + */ + .ios.standalone & { + padding-top: 36px; + margin: 0; + } + } + + /* + * Sub headlines + */ + h3, h4 { + font-size: 14px; + padding-top: (20px + 56px); + margin-top: (0 - 56px); + + /* + * No offset correction in iOS web application + */ + .ios.standalone & { + padding-top: 20px; + margin-top: 0; + } + } + + /* + * Align permalinks on the right + */ + .headerlink { + float: right; + margin-left: 20px; + font-size: 14px; + + /* + * Hide permalink to main headline + */ + h1 & { + display: none; + } + } + + /* + * Paragraphs and section titles + */ + p, ul, ol { + margin-top: 1.5em; + } + + /* + * Smaler top spacing for nested lists + */ + li ul, li ol { + margin-top: 0.75em; + } + + /* + * List elements + */ + li { + margin-top: 0.75em; + margin-left: 18px; + + /* + * Inline paragraphs in list elements + */ + p { + display: inline; + } + } + + /* + * Add icon for elements of an unordered list + */ + ul > li:before { + content: "\e602"; + display: block; + float: left; + font-family: 'Icon'; + font-size: 16px; + width: 1.2em; + margin-left: -1.2em; + vertical-align: -0.1em; + } + + /* + * Inline code snippets must not wrap + */ + p > code { + white-space: nowrap; + padding: 2px 4px; + } + + /* + * Keyboard tags + */ + kbd { + display: inline-block; + padding: 3px 5px; + line-height: 10px; + } + + /* + * Add spacing at top of separator + */ + hr { + margin-top: 1.5em; + } + + /* + * Limit images to article container + */ + img { + max-width: 100%; + } + + /* + * Code listing container + */ + pre { + padding: 16px; + margin: 1.5em -16px 0; + line-height: 1.5em; + overflow: auto; + -webkit-overflow-scrolling: touch; + } + + /* + * Data tables + */ + table { + margin: 3.0em 0 1.5em; + font-size: 13px; + overflow: hidden; + + /* + * The semi-cool solution, in case javascript is not available + */ + .no-js & { + display: inline-block; + max-width: 100%; + overflow: auto; + -webkit-overflow-scrolling: touch; + } + + /* + * Table heading + */ + th { + min-width: 100px; + padding: 12px 16px; + font-size: 12px; + text-align: left; + vertical-align: top; + } + + /* + * Table cell + */ + td { + padding: 12px 16px; + vertical-align: top; + } + } + + /* + * Blockquote styles + */ + blockquote { + padding-left: 16px; + } + + /* + * Data table wrapper, in case javascript is available + */ + .data { + margin: 1.5em -16px; + padding: 1.5em 0; + overflow: auto; + -webkit-overflow-scrolling: touch; + text-align: center; + + /* + * Data table + */ + table { + display: inline-block; + margin: 0 16px; + text-align: left; + } + + /* [tablet portait+]: Increase spacing */ + @include break-from-device(tablet portrait) { + margin: 1.5em -24px; + + /* + * Data table + */ + table { + margin: 0 24px; + } + } + } + + /* [tablet portait+]: Increase spacing */ + @include break-from-device(tablet portrait) { + + /* + * Account for larged header bar and anchors + */ + h2 { + padding-top: (28px + 72px); + margin-top: (8px - 72px); + + /* + * No offset correction in iOS web application + */ + .ios.standalone & { + padding-top: 28px; + margin-top: 8px; + } + } + + /* + * Sub headlines + */ + h3, h4 { + padding-top: (20px + 64px); + margin-top: (0 - 64px); + + /* + * No offset correction in iOS web application + */ + .ios.standalone & { + padding-top: 20px; + margin-top: 0; + } + } + + /* + * Increase spacing for code blocks + */ + pre { + padding: 1.5em 24px; + margin: 1.5em -24px 0; + } + } +} + +/* + * Article footer + */ +.footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 0 4px; + + /* [tablet portait+]: Larger spacing */ + @include break-from-device(tablet portrait) { + padding: 0 8px; + } + + /* [tablet landscape+]: Stretch footer to viewport */ + @include break-from-device(tablet landscape) { + z-index: 5; + } +} + +/* + * Copyright and theme information + */ +.copyright { + margin: 1.5em 0; + + /* [tablet landscape+]: Add bottom spacing */ + @include break-from-device(tablet landscape) { + margin-bottom: 64px; + } +} + +/* + * Pagination + */ +.pagination { + max-width: 1184px; + height: 92px; + padding: 4px 0; + margin-left: auto; + margin-right: auto; + overflow: hidden; + + /* [tablet portait+]: Larger pagination and spacing */ + @include break-from-device(tablet portrait) { + height: 96px; + padding: 8px 0; + } + + /* + * Links should span icons entirely + */ + a { + display: block; + height: 100%; + } + + /* + * Previous and next page + */ + .previous, + .next { + position: relative; + float: left; + height: 100%; + } + + /* + * Previous page + */ + .previous { + width: 25%; + + /* + * Hide direction + */ + .direction { + display: none; + } + + /* + * Hide title + */ + .stretch { + display: none; + } + } + + /* + * Next page + */ + .next { + width: 75%; + text-align: right; + } + + /* + * Link to page + */ + .page { + display: table; + position: absolute; + bottom: 4px; + } + + /* + * Put direction over page title + */ + .direction { + display: block; + position: absolute; + bottom: 40px; + width: 100%; + font-size: 15px; + line-height: 20px; + padding: 0 52px; + } + + /* + * Decrease indent for stretching content + */ + .stretch { + padding: 0 4px; + + /* + * Correct vertical spacing + */ + .title { + font-size: 18px; + padding: 11px 0 13px; + } + } + + /* [mobile landscape+]: Proportional width for pagination */ + @include break-from-device(mobile landscape) { + + /* + * Previous and next page + */ + .previous, + .next { + width: 50%; + } + + /* + * Previous page + */ + .previous { + width: 50%; + + /* + * Show direction + */ + .direction { + display: block; + } + + /* + * Show title + */ + .stretch { + display: table; + } + } + } + + /* [tablet portrait+]: Increase vertical spacing */ + @include break-from-device(tablet portrait) { + + /* + * Increase vertical spacing + */ + .direction { + padding: 0 56px; + bottom: 40px; + } + + /* + * Increase vertical spacing + */ + .stretch { + padding: 0 8px; + } + } +} + +/* + * Admonition support + */ +.admonition { + margin: 20px -16px 0; + padding: 20px 16px; + + /* + * Remove redundant margin of first child + */ + > :first-child { + margin-top: 0; + } + + /* [tablet portait+]: Increase horizontal spacing */ + @include break-from-device(tablet portrait) { + margin: 20px -24px 0; + padding: 20px 24px; + } + + /* + * Admonition title, if given + */ + .admonition-title { + font-size: 20px; + + /* + * Default icon + */ + &:before { + content: "\e611"; + display: block; + float: left; + font-family: 'Icon'; + font-size: 24px; + vertical-align: -0.1em; + margin-right: 5px; + } + } + + /* + * Warning icon + */ + &.warning .admonition-title:before { + content: "\e610"; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/article/_typography.scss b/mkdocs-material/src/assets/stylesheets/modules/article/_typography.scss new file mode 100644 index 00000000..c657a7a2 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/article/_typography.scss @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Article typography + * ------------------------------------------------------------------------- */ + +/* + * Article + */ +.article { + + /* + * Third-level headlines should be bold + */ + h3 { + font-weight: 700; + } + + /* + * Fourth-level headlines should be italic + */ + h4 { + font-weight: 400; + font-style: italic; + } +} + +/* + * Permalink support + */ +.article { + h2, h3, h4, h5, h6 { + a { + font-weight: 400; + font-style: normal; + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/base/_animation.scss b/mkdocs-material/src/assets/stylesheets/modules/base/_animation.scss new file mode 100644 index 00000000..720621f6 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/base/_animation.scss @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Base animation + * ------------------------------------------------------------------------- */ + +/* + * Animate color on hover + */ +a { + transition: color .25s; +} + +/* + * Overlay + */ +.overlay { + transition: opacity .25s, + width .0s .25s, + height .0s .25s; + + /* + * Expanded drawer + */ + #toggle-drawer:checked ~ &, + .toggle-drawer & { + transition: opacity .25s, + width .0s, + height .0s; + } +} + +/* + * Application header - check for javascript to omit flashing + */ +.js .header { + transition: background .6s, + color .6s; + + /* + * Status bar + */ + &:before { + transition: background .6s; + } +} + +/* + * Extended visible touch area on icon + */ +.button .icon { + transition: background .25s; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/base/_appearance.scss b/mkdocs-material/src/assets/stylesheets/modules/base/_appearance.scss new file mode 100644 index 00000000..5f0870c1 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/base/_appearance.scss @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Base appearance + * ------------------------------------------------------------------------- */ + +/* + * Device specific background hacks related to rubberband + */ +body { + color: $black; + + /* Hack [Chrome, Opera]: Set background color in Chrome and Opera */ + @supports (-webkit-appearance: none) { + background: $primary; + } + + /* + * Don't tint menu bar on iOS + */ + .ios & { + background: $white; + } +} + +/* + * Horizontal separators + */ +hr { + border: 0; + border-top: 1px solid $black-lightest; +} + +/* + * Toggle button + */ +.toggle-button { + cursor: pointer; + color: inherit; +} + +/* + * Backdrop + */ +.backdrop { + background: $white; + + /* [tablet landscape+]: Introduce paper with shadow */ + @include break-from-device(tablet landscape) { + background: darken($white, 5%); + } +} + +/* + * Backdrop paper with shadow + */ +.backdrop-paper:after { + background: $white; + + /* [tablet landscape+]: Add drop shadow */ + @include break-from-device(tablet landscape) { + @include drop-shadow(1); + } +} + +/* + * Overlay + */ +.overlay { + background: $black-light; + opacity: 0; + + /* + * Expanded drawer + */ + #toggle-drawer:checked ~ &, + .toggle-drawer & { + opacity: 1; + } +} + +/* + * Application header + */ +.header { + @include drop-shadow(1); + + background: $primary; + color: $white; + + /* + * Add status bar overlay for iOS web application + */ + .ios.standalone &:before { + background: $black-lightest; + } +} + +/* + * Navigation path within header bar + */ +.bar .path { + color: $white-light; +} + +/* + * Draw round area around icon on touch + */ +.button .icon { + border-radius: 100%; +} + +/* + * Pushed/clicked icon + */ +.button .icon:active { + background: $white-lightest; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/base/_layout.scss b/mkdocs-material/src/assets/stylesheets/modules/base/_layout.scss new file mode 100644 index 00000000..2a456915 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/base/_layout.scss @@ -0,0 +1,363 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Base layout + * ------------------------------------------------------------------------- */ + +/* + * Stretch container to viewport + */ +html { + height: 100%; +} + +/* + * Stretch body to container and leave room for sticky footer. + */ +body { + position: relative; + min-height: 100%; +} + +/* + * Horizontal separators + */ +hr { + display: block; + height: 1px; + padding: 0; + margin: 0; +} + +/* + * Lock body (e.g. in search mode) + */ +.locked { + height: 100%; + overflow: hidden; +} + +/* + * Scrollable container + */ +.scrollable { + @include position(absolute, 0 0 0 0); + + overflow: auto; + -webkit-overflow-scrolling: touch; + + /* + * Content wrapper + */ + .wrapper { + height: 100%; + + /* Hack [iOS]: Force overflow scrolling */ + .ios & { + margin-bottom: 2px; + } + } +} + +/* + * Toggle states and button + */ +.toggle { + display: none; + + /* + * Toggle button + */ + &-button { + display: block; + } +} + +/* + * Backdrop + */ +.backdrop { + @include position(absolute, 0 0 0 0); + + z-index: -1; +} + +/* + * Backdrop paper container + */ +.backdrop-paper { + max-width: 1200px; + height: 100%; + margin-left: auto; + margin-right: auto; + + /* + * Actual paper + */ + &:after { + content: " "; + display: block; + height: 100%; + margin-left: 262px; + } +} + +/* + * Overlay + */ +.overlay { + position: fixed; + top: 0; + width: 0; + height: 0; + z-index: 4; + + /* [tablet landscape-]: Trigger overlay */ + @include break-to-device(tablet landscape) { + + /* + * Expanded drawer + */ + #toggle-drawer:checked ~ &, + .toggle-drawer & { + width: 100%; + height: 100%; + } + } +} + +/* + * Application header stays always on top + */ +.header { + @include user-select(none); + + position: fixed; + top: 0; + left: 0; + z-index: 3; + height: 56px; + padding: 4px; + overflow: hidden; + + /* [tablet portait+]: Larger header bar */ + @include break-from-device(tablet portrait) { + height: 64px; + padding: 8px; + } + + /* [screen+]: Stretch to screen */ + @include break-from-device(screen) { + width: 100%; + } + + /* + * Absolute positioning in iOS web application + */ + .ios.standalone & { + position: absolute; + + /* [orientation: portrait]: Account for status bar in portrait mode */ + @include break-at-orientation(portrait) { + height: (56px + 20px); + padding-top: (4px + 20px); + + /* [tablet portait+]: Larger header bar */ + @include break-from-device(tablet portrait) { + height: (64px + 20px); + padding-top: (8px + 20px); + } + + /* + * Add status bar overlay + */ + &:before { + content: " "; + position: absolute; + top: 0; + left: 0; + z-index: 4; + width: 100%; + height: 20px; + } + } + } +} + +/* + * Header bar + */ +.bar { + display: table; + max-width: 1184px; + margin-left: auto; + margin-right: auto; + + /* + * Links should span icons entirely + */ + a { + display: block; + } + + /* + * Hide search button, in case javascript is not available. + */ + .no-js & .button-search { + display: none; + } + + /* + * Navigation path + */ + .path { + + /* + * Correct icon alignment + */ + .icon:before { + vertical-align: -1.5px; + } + + /* [tablet portait-]: Hide path */ + @include break-to-device(tablet portrait) { + display: none; + } + } +} + +/* + * Buttons + */ +.button { + display: table-cell; + vertical-align: top; + width: 1%; + + /* + * Remove native spacing on button + */ + button { + margin: 0; + padding: 0; + + /* Hack [IE]: Remove button offset in active state */ + &:active:before { + position: relative; + top: 0; + left: 0; + } + } + + /* + * Button icons + */ + .icon { + display: inline-block; + font-size: 24px; + padding: 8px; + margin: 4px; + } +} + +/* + * Hide source and twitter button + */ +.button-github, +.button-twitter { + + /* [mobile landscape-]: Hide button */ + @include break-to-device(mobile landscape) { + display: none; + } +} + +/* + * Hide menu button + */ +.button-menu { + + /* [tablet landscape+]: Hide button */ + @include break-from-device(tablet landscape) { + display: none; + } +} + +/* + * Stretch content to remaining space + */ +.stretch { + display: table; + table-layout: fixed; + width: 100%; + + /* + * Set vertical spacing for header + */ + .header & { + padding: 0 20px; + + /* [tablet portait]: Increase vertical spacing */ + @include break-at-device(tablet portrait) { + padding: 0 24px; + } + + /* [tablet portait+]: Account for missing menu icon */ + @include break-from-device(tablet portrait) { + padding: 0 (24px - 8px) 0 16px; + } + } + + /* + * Title with ellipsis on overflow + */ + .title { + display: table-cell; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + /* + * Increase header font size + */ + .header & { + font-size: 18px; + padding: 13px 0; + + /* [tablet portait+]: Slightly larger typography in header */ + @include break-from-device(tablet portrait) { + font-size: 20px; + padding: 12px 0; + } + } + } +} + +/* + * Main content + */ +.main { + max-width: 1200px; + margin-left: auto; + margin-right: auto; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/base/_typography.scss b/mkdocs-material/src/assets/stylesheets/modules/base/_typography.scss new file mode 100644 index 00000000..037e46a5 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/base/_typography.scss @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Base typography + * ------------------------------------------------------------------------- */ + +/* + * Default font styles + */ +body, input { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 400; + + /* Enable font-smoothing in Webkit and FF */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + /* + * Use system fonts, if browser doesn't support webfonts + */ + .no-fontface & { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + } +} + +/* + * Proportional fonts + */ +pre, code, kbd { + font-family: 'Courier New', 'Courier', monospace; + + /* + * Use system fonts, if browser doesn't support webfonts + */ + .no-fontface & { + font-family: 'Courier New', 'Courier', monospace; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/drawer/_animation.scss b/mkdocs-material/src/assets/stylesheets/modules/drawer/_animation.scss new file mode 100644 index 00000000..16077f9b --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/drawer/_animation.scss @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Drawer animation + * ------------------------------------------------------------------------- */ + +/* + * Drawer container + */ +.drawer { + + /* [tablet landscape-]: Hide menu */ + @include break-to-device(tablet landscape) { + transform: translate3d(-262px, 0, 0); + transition: transform .25s cubic-bezier(.4, 0, .2, 1); + + /* + * Just hide drawer, if browser doesn't support 3D transforms + */ + .no-csstransforms3d & { + display: none; + } + } + + /* + * Expanded drawer + */ + #toggle-drawer:checked ~ .main &, + .toggle-drawer & { + transform: translate3d(0, 0, 0); + + /* + * Just show drawer, if browser doesn't support 3D transforms + */ + .no-csstransforms3d & { + display: block; + } + } +} + +/* + * No color transition for project link + */ +.project { + transition: none; +} + +/* + * Project logo image + */ +.project .logo img { + transition: box-shadow .4s; +} + +/* + * Repository buttons + */ +.repo a { + transition: box-shadow .4s, + opacity .4s; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/drawer/_appearance.scss b/mkdocs-material/src/assets/stylesheets/modules/drawer/_appearance.scss new file mode 100644 index 00000000..b4f9926a --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/drawer/_appearance.scss @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Drawer appearance + * ------------------------------------------------------------------------- */ + +/* + * Drawer container + */ +.drawer { + + /* [tablet landscape-]: Light gray background */ + @include break-to-device(tablet landscape) { + background: $white; + } + + /* + * Color links + */ + .toc a { + + /* + * Current active element + */ + &.current { + color: $primary; + } + + /* + * Hovered link + */ + &:hover, &:focus { + color: $primary; + } + } + + /* + * Color anchors menu + */ + .anchor a { + border-left: 2px solid $primary; + } + + /* + * Main sections + */ + .section { + color: $black-light; + } +} + +/* + * Project information + */ +.project { + + /* [tablet landscape-]: Add drop shadow */ + @include break-to-device(tablet landscape) { + @include drop-shadow(1); + + background: $primary; + color: $white; + } + + /* + * Add status bar overlay for iOS web application + */ + .ios.standalone &:before { + background: $black-lightest; + } + + /* + * Project logo + */ + .logo img { + background: $white; + border-radius: 100%; + } + + /* + * Scale logo on hover + */ + &:hover .logo img, + &:focus .logo img { + @include drop-shadow(2); + } +} + +/* + * Repository buttons + */ +.repo a { + background: $accent; + color: $white; + border-radius: 3px; + + /* + * Hovered button + */ + &:hover, &:focus { + @include drop-shadow(2); + + opacity: 0.8; + } + + /* + * Stars + */ + .count { + background: $black-lighter; + color: $white; + border-radius: 0px 3px 3px 0px; + + /* + * Star bubble + */ + &:before { + border-width: 15px 5px 15px 0; + border-color: transparent $black-lighter; + border-style: solid; + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/drawer/_layout.scss b/mkdocs-material/src/assets/stylesheets/modules/drawer/_layout.scss new file mode 100644 index 00000000..d6e1df28 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/drawer/_layout.scss @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Drawer layout + * ------------------------------------------------------------------------- */ + +/* + * Drawer container + */ +.drawer { + width: 262px; + font-size: 13px; + line-height: 1.0em; + + /* [tablet landscape-]: Fixed positioning */ + @include break-to-device(tablet landscape) { + position: fixed; + z-index: 5; + height: 100%; + } + + /* [tablet landscape+]: Inline with content */ + @include break-from-device(tablet landscape) { + position: static; + float: left; + height: auto; + margin-bottom: 96px; + padding-top: 80px; + } + + /* Hack [iOS]: Mitigate scrolling of parent container on boundaries */ + .ios & { + overflow: scroll; + -webkit-overflow-scrolling: touch; + } + + /* + * Links to articles + */ + .toc li a { + display: block; + padding: 14.5px 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + /* + * Links to anchors + */ + .toc li.anchor a { + margin-left: 12px; + padding: 10px 24px 10px 12px; + } + + /* + * Nested links and anchors + */ + .toc li ul { + margin-left: 12px; + } + + /* + * Nested anchors + */ + .current + ul { + margin-bottom: 9px; + } + + /* + * Main sections + */ + .section { + display: block; + padding: 14.5px 24px; + } + + /* + * Scrollable container + */ + .scrollable { + top: 104px; + z-index: -1; + + /* [tablet landscape+]: Revert fixed positioning */ + @include break-from-device(tablet landscape) { + position: static; + } + + /* + * Leave room for status bar in iOS web application + */ + .ios.standalone & { + + /* [orientation: portrait]: Account for status bar in portrait mode */ + @include break-at-orientation(portrait) { + top: (104px + 20px); + } + } + + /* + * Content wrapper + */ + .wrapper { + height: auto; + min-height: 100%; + + /* + * Add spacing at top and bottom of separator + */ + hr { + margin: 12px 0; + + /* [screen+]: Shorten separator */ + @include break-from-device(screen) { + width: 48px; + } + + /* Hack [IE]: Left-align horizontal rule */ + margin-right: auto; + } + + /* + * Add spacing at top and bottom of top level navigation + */ + .toc { + margin: 12px 0; + } + } + } +} + +/* + * Project information + */ +.project { + display: block; + + /* + * Leave room for status bar in iOS web application + */ + .ios.standalone & { + + /* [orientation: portrait]: Account for status bar in portrait mode */ + @include break-at-orientation(portrait) { + padding-top: 20px; + + /* + * Add status bar overlay + */ + &:before { + content: " "; + position: absolute; + top: 0; + left: 0; + z-index: 4; + width: 100%; + height: 20px; + } + } + } + + /* + * Project banner + */ + .banner { + display: table; + width: 100%; + height: 104px; + padding: 20px; + } + + /* + * Project logo + */ + .logo { + display: table-cell; + width: 64px; + padding-right: 12px; + + /* + * Project logo image + */ + img { + display: block; + width: 64px; + height: 64px; + } + } + + /* + * Project name + */ + .name { + display: table-cell; + padding-left: 4px; + font-size: 14px; + line-height: 1.25em; + vertical-align: middle; + + /* [tablet portait+]: Slightly larger project name */ + @include break-from-device(tablet portrait) { + margin: 26px 0 0 5px; + } + } + + /* + * Shrink font, if a logo is given. + */ + .logo + .name { + font-size: 12px; + } +} + +/* + * Repository + */ +.repo { + margin: 24px 0; + text-align: center; + + /* + * Inline buttons + */ + li { + display: inline-block; + padding-right: 12px; + white-space: nowrap; + + /* + * No padding on last button + */ + &:last-child { + padding-right: 0; + } + } + + /* + * Buttons + */ + a { + display: inline-block; + padding: 0px 10px 0px 6px; + font-size: 12px; + line-height: 30px; + height: 30px; + + /* + * Slightly larger icons + */ + .icon { + font-size: 18px; + vertical-align: -3px; + } + + /* + * Stars + */ + .count { + display: inline-block; + position: relative; + padding: 0px 8px 0 4px; + margin: 0 -10px 0 8px; + font-size: 12px; + + /* + * Star bubble + */ + &:before { + content: " "; + display: block; + position: absolute; + top: 0px; + left: -5px; + } + + /* + * Hide count, in case javascript is not available. + */ + .no-js & { + display: none; + } + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/drawer/_typography.scss b/mkdocs-material/src/assets/stylesheets/modules/drawer/_typography.scss new file mode 100644 index 00000000..78ea4f24 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/drawer/_typography.scss @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Drawer typography + * ------------------------------------------------------------------------- */ + +/* + * Drawer container + */ +.drawer { + + /* + * Links to articles + */ + .toc li a { + font-weight: 700; + } + + /* + * Links to chapters inside the current article + */ + .toc li.anchor a { + font-weight: 400; + } + + /* + * Main sections + */ + .section { + font-weight: 700; + } +} + +/* + * Repository buttons + */ +.repo a { + text-transform: uppercase; + font-weight: 700; + + /* + * Stars + */ + .count { + text-transform: none; + font-weight: 700; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/search/_animation.scss b/mkdocs-material/src/assets/stylesheets/modules/search/_animation.scss new file mode 100644 index 00000000..37df48f3 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/search/_animation.scss @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Search animation + * ------------------------------------------------------------------------- */ + +/* + * Animate header bar in offset and opacity + */ +.bar { + transform: translate3d(0, 0, 0); + transition: opacity .2s cubic-bezier(.75, 0, .25, 1), + transform .4s cubic-bezier(.75, 0, .25, 1); + + /* + * Active search mode + */ + #toggle-search:checked ~ .header &, + .toggle-search & { + transform: translate3d(0, -56px, 0); + } + + /* + * Search animations + */ + &.search { + + /* + * Hide reset button by default + */ + .button-reset { + transform: scale(0.5, 0.5); + transition: opacity .4s cubic-bezier(.1, .7, .1, 1), + transform .4s cubic-bezier(.1, .7, .1, 1); + opacity: 0; + } + + /* + * Show reset button if search is not empty + */ + &.non-empty .button-reset { + transform: scale(1.0, 1.0); + opacity: 1; + } + } +} + +/* + * Search results + */ +.results { + transition: opacity .3s .1s, + width .0s .4s, + height .0s .4s; + + /* + * Active search mode + */ + #toggle-search:checked ~ .main &, + .toggle-search & { + transition: opacity .4s, + width .0s, + height .0s; + } + + /* + * Search result item link + */ + .list a { + transition: background .25s; + } +} + +/* + * Just hide and show bars, if browser doesn't support 3D transforms + */ +.no-csstransforms3d { + + /* + * Show default bar + */ + .bar.default { + display: table; + } + + /* + * Hide search bar + */ + .bar.search { + display: none; + margin-top: 0; + } + + /* + * Active search mode + */ + #toggle-search:checked ~ .header, + .toggle-search { + + /* + * Hide default bar + */ + .bar.default { + display: none; + } + + /* + * Show search bar + */ + .bar.search { + display: table; + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/search/_appearance.scss b/mkdocs-material/src/assets/stylesheets/modules/search/_appearance.scss new file mode 100644 index 00000000..045cd761 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/search/_appearance.scss @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Search appearance + * ------------------------------------------------------------------------- */ + +/* + * Search bar + */ +.bar.search { + opacity: 0; + + /* + * Search input + */ + .query { + background: transparent; + color: $black; + + /* + * Search input placeholder + */ + @include placeholder { + color: $black-lighter; + } + } + + /* + * Pushed/clicked icon + */ + .button .icon:active { + background: $black-lightest; + } +} + +/* + * Search results + */ +.results { + @include drop-shadow(2); + + background: $white; + color: $black; + opacity: 0; + + /* + * Active search mode + */ + #toggle-search:checked ~ .main &, + .toggle-search & { + opacity: 1; + } + + /* + * Search meta data + */ + .meta { + background: $primary; + color: $white; + } + + /* + * Search result item link + */ + .list a { + border-bottom: 1px solid $black-lightest; + + /* + * Remove border on last element + */ + &:last-child { + border-bottom: none; + } + + /* + * Active item link + */ + &:active { + background: $black-lightest; + } + } +} + +/* + * Article link + */ +.result span { + color: $black-light; +} + +/* + * Active search bar + */ +#toggle-search:checked ~ .header, +.toggle-search .header { + background: $white; + color: $black-light; + + /* + * Add darker status bar overlay in search mode + */ + &:before { + background: $black-light; + } + + /* + * Fade out default header bar + */ + .bar.default { + opacity: 0; + } + + /* + * Fade in search header bar + */ + .bar.search { + opacity: 1; + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/search/_layout.scss b/mkdocs-material/src/assets/stylesheets/modules/search/_layout.scss new file mode 100644 index 00000000..33c89be9 --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/search/_layout.scss @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Search layout + * ------------------------------------------------------------------------- */ + +/* + * Search bar + */ +.bar.search { + margin-top: 8px; + + /* + * Search input + */ + .query { + font-size: 18px; + padding: 13px 0; + margin: 0; + width: 100%; + height: 48px; + + /* [tablet portait+]: Slightly larger typo */ + @include break-from-device(tablet portrait) { + font-size: 20px; + padding: 12px 0; + } + + /* Hack [IE]: Hide redundant clear button */ + &::-ms-clear { + display: none; + } + } +} + +/* + * Search results + */ +.results { + position: fixed; + top: 0; + left: 0; + width: 0; + height: 100%; + z-index: 2; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; + + /* [tablet landscape+]: Limit results to five entries */ + @include break-from-device(tablet landscape) { + height: auto; + top: 64px; + } + + /* + * Scrollable container + */ + .scrollable { + top: 56px; + + /* [tablet portait+]: Increase vertical spacing */ + @include break-from-device(tablet portrait) { + top: 64px; + } + + /* [tablet landscape+]: Limit results to five entries */ + @include break-from-device(tablet landscape) { + position: static; + max-height: 413px; + } + + /* + * Leave room for status bar in iOS web application + */ + .ios.standalone & { + + /* [orientation: portrait]: Account for status bar in portrait mode */ + @include break-at-orientation(portrait) { + top: (56px + 20px); + + /* [tablet portait+]: Increase vertical spacing */ + @include break-from-device(tablet portrait) { + top: (64px + 20px); + } + } + } + } + + /* + * Active search mode + */ + #toggle-search:checked ~ .main &, + .toggle-search & { + width: 100%; + + /* Hack [Firefox]: div doesn't collapse, unless this is applied */ + overflow-y: visible; + + /* [tablet portait+]: Stretch to viewport */ + @include break-to-device(tablet landscape) { + height: 100%; + } + } + + /* + * Search meta data + */ + .meta { + font-weight: 700; + + /* + * Number of results + */ + strong { + display: block; + font-size: 11px; + max-width: 1200px; + margin-left: auto; + margin-right: auto; + padding: 16px; + + /* [tablet portait+]: Increase vertical spacing */ + @include break-from-device(tablet portrait) { + padding: 16px 24px; + } + } + } + + /* + * Search result item link + */ + .list a { + display: block; + } +} + +/* + * Search result item + */ +.result { + max-width: 1200px; + margin-left: auto; + margin-right: auto; + padding: 12px 16px 16px; + + /* [tablet portait+]: Increase vertical spacing */ + @include break-from-device(tablet portrait) { + padding: 16px 24px 20px; + } + + /* + * Article title + */ + h1 { + line-height: 24px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } + + /* + * Article link + */ + span { + font-size: 12px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } +} + +/* + * Switch visibility, if browser doesn't support 3D transforms + */ +.no-csstransforms3d { + + /* + * Hide search results + */ + .results { + display: none; + } + + /* + * Active search mode + */ + #toggle-search:checked ~ .main, + .toggle-search { + + /* + * Show search results + */ + .results { + display: block; + overflow: auto; + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/modules/search/_typography.scss b/mkdocs-material/src/assets/stylesheets/modules/search/_typography.scss new file mode 100644 index 00000000..465f20ed --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/modules/search/_typography.scss @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* + * Search meta data + */ +.meta { + text-transform: uppercase; + font-weight: 700; +}
\ No newline at end of file diff --git a/mkdocs-material/src/assets/stylesheets/palettes.scss b/mkdocs-material/src/assets/stylesheets/palettes.scss new file mode 100644 index 00000000..fe2fc69e --- /dev/null +++ b/mkdocs-material/src/assets/stylesheets/palettes.scss @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* ---------------------------------------------------------------------------- + * Dependencies + * ------------------------------------------------------------------------- */ + +@import "bourbon"; +@import "quantum-colors"; +@import "quantum-shadows"; + +/* ---------------------------------------------------------------------------- + * Application + * ------------------------------------------------------------------------- */ + +@import "palette"; + +@import "mixins/break"; + +/* ---------------------------------------------------------------------------- + * Palette + * ------------------------------------------------------------------------- */ + +/* + * Build primary palette + */ +@each $name, $color in ( + 'red': $red-400, + 'pink': $pink-500, + 'purple': $purple-400, + 'deep-purple': $deep-purple-400, + 'indigo': $indigo-500, + 'blue': $blue-500, + 'light-blue': $light-blue-500, + 'cyan': $cyan-500, + 'teal': $teal-500, + 'green': $green-500, + 'light-green': $light-green-600, + 'lime': $lime-600, + 'yellow': $yellow-800, + 'amber': $amber-600, + 'orange': $orange-600, + 'deep-orange': $deep-orange-400, + 'brown': $brown-500, + 'grey': $grey-600, + 'blue-grey': $blue-grey-600 +) { + + /* + * Device specific background hacks related to rubberband + */ + .palette-primary-#{$name} { + + /* Hack [Chrome, Opera]: Set background color in Chrome and Opera */ + @supports (-webkit-appearance: none) { + background: $color; + } + + /* + * Application header and footer + */ + .header, .footer { + background: $color; + } + + /* + * Drawer container + */ + .drawer { + + /* + * Color links + */ + .toc a { + + /* + * Current active element + */ + &.current { + color: $color; + } + + /* + * Hovered link + */ + &:hover, &:focus { + color: $color; + } + } + + /* + * Color anchors menu + */ + .anchor a { + border-left: 2px solid $color; + } + } + + /* + * Project information + */ + .project { + + /* [tablet landscape-]: Set background color */ + @include break-to-device(tablet landscape) { + background: $color; + } + } + + /* + * Article + */ + .article { + + /* + * Differing top and bottom rubberband backgrounds in iOS web application + */ + .ios.standalone & { + background: linear-gradient( + to bottom, $white 50%, $color 50%); + } + + /* + * Headlines, chapters, links and inline code + */ + h1, h2, a, code { + color: $color; + } + + /* + * Light permalinks + */ + .headerlink { + color: $black-lighter; + } + + /* + * Data table headings + */ + table th { + background: mix($color, $white, 75%); + } + } + + /* + * Search meta data + */ + .results .meta { + background: $color; + } + } +} + +/* + * Build accent palette + */ +@each $name, $color in ( + 'red': $red-a400, + 'pink': $pink-a400, + 'purple': $purple-a200, + 'deep-purple': $deep-purple-a200, + 'indigo': $indigo-a200, + 'blue': $blue-a200, + 'light-blue': $light-blue-a700, + 'cyan': $cyan-a700, + 'teal': $teal-a700, + 'green': $green-a700, + 'light-green': $light-green-a700, + 'lime': $lime-a700, + 'yellow': $yellow-a700, + 'amber': $amber-a700, + 'orange': $orange-a400, + 'deep-orange': $deep-orange-a200 +) { + + /* + * Device specific background hacks related to rubberband + */ + .palette-accent-#{$name} { + + /* + * Article + */ + .article { + + /* + * Hovered and focused links + */ + a:hover, + a:focus { + color: $color; + } + } + + /* + * Repository buttons + */ + .repo a { + background: $color; + } + } +}
\ No newline at end of file diff --git a/mkdocs-material/src/base.html b/mkdocs-material/src/base.html new file mode 100644 index 00000000..23969d4b --- /dev/null +++ b/mkdocs-material/src/base.html @@ -0,0 +1,265 @@ +<!DOCTYPE html> +<!--[if lt IE 7 ]> <html class="no-js ie6"> <![endif]--> +<!--[if IE 7 ]> <html class="no-js ie7"> <![endif]--> +<!--[if IE 8 ]> <html class="no-js ie8"> <![endif]--> +<!--[if IE 9 ]> <html class="no-js ie9"> <![endif]--> +<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]--> + <head> + + <!-- Charset and viewport --> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, + user-scalable=no, initial-scale=1, maximum-scale=1" /> + + <!-- General meta tags --> + {% block htmltitle %} + + <!-- Site title --> + {% if page_title %} + <title>{{ page_title }} - {{ site_name }}</title> + {% elif page_description %} + <title>{{ site_name }} - {{ page_description }}</title> + {% else %} + <title>{{ site_name }}</title> + {% endif %} + + <!-- Site description --> + {% if page_description %} + <meta name="description" content="{{ page_description }}" /> + {% endif %} + + <!-- Canonical --> + {% if canonical_url %} + <link rel="canonical" href="{{ canonical_url }}" /> + {% endif %} + + <!-- Author --> + {% if site_author %} + <meta name="author" content="{{ site_author }}" /> + {% endif %} + {% endblock %} + + <!-- Open graph tags --> + <meta property="og:url" content="{{ canonical_url }}" /> + <meta property="og:title" content="{{ site_name }}"/> + <meta property="og:image" + content="{{ canonical_url }}/{{ base_url }}/{{ config.extra.logo }}" /> + + <!-- Web application capability on iOS --> + <meta name="apple-mobile-web-app-title" content="{{ site_name }}" /> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" + content="black-translucent" /> + + <!-- Web application icon on iOS --> + {% if config.extra.logo %} + <link rel="apple-touch-icon" + href="{{ base_url }}/{{ config.extra.logo }}"> + {% endif %} + + <!-- Favicon --> + {% set favicon = favicon | default("assets/images/favicon.ico", true) %} + <link rel="shortcut icon" type="image/x-icon" + href="{{ base_url }}/{{ favicon }}" /> + <link rel="icon" type="image/x-icon" + href="{{ base_url }}/{{ favicon }}" /> + + <!-- Configure icons (placed here to omit issues with subdirectories) --> + <style> + @font-face { + font-family: 'Icon'; + src: url('{{ base_url }}/assets/fonts/icon.eot?52m981'); + src: url('{{ base_url }}/assets/fonts/icon.eot?#iefix52m981') + format('embedded-opentype'), + url('{{ base_url }}/assets/fonts/icon.woff?52m981') + format('woff'), + url('{{ base_url }}/assets/fonts/icon.ttf?52m981') + format('truetype'), + url('{{ base_url }}/assets/fonts/icon.svg?52m981#icon') + format('svg'); + font-weight: normal; + font-style: normal; + } + </style> + + <!-- Theme-related stylesheets --> + <link rel="stylesheet" type="text/css" + href="{{ base_url }}/assets/stylesheets/application.css" /> + + <!-- Extra palettes --> + {% if config.extra.palette %} + <link rel="stylesheet" type="text/css" + href="{{ base_url }}/assets/stylesheets/palettes.css" /> + {% endif %} + + <!-- Configure webfonts --> + {% if config.extra.font != "none" %} + {% set text = config.extra.get("font", {}).text | default("Ubuntu") %} + {% set code = config.extra.get("font", {}).code | default("Ubuntu Mono") %} + {% set font = text + ':400,700|' + code | replace(' ', '+') %} + <link rel="stylesheet" type="text/css" + href="https://fonts.googleapis.com/css?family={{ font }}" /> + <style> + body, input { + font-family: '{{ text }}', Helvetica, Arial, sans-serif; + } + pre, code { + font-family: '{{ code }}', 'Courier New', 'Courier', monospace; + } + </style> + {% endif %} + + <!-- Custom stylesheets --> + {% for path in extra_css %} + <link rel="stylesheet" type="text/css" href="{{ path }}" /> + {% endfor %} + + <!-- Modernizr --> + <script src="{{ base_url }}/assets/javascripts/modernizr.js"></script> + + <!-- Custom header --> + {% block extrahead %}{% endblock %} + </head> + + <!-- Define palette --> + {% set palette = config.extra.get("palette", {}) %} + {% set primary = palette.primary | replace(' ', '-') | lower %} + {% set accent = palette.accent | replace(' ', '-') | lower %} + <body class=" + {% if primary %}palette-primary-{{ primary }}{% endif %} + {% if accent %}palette-accent-{{ accent }}{% endif %} + "> + + <!-- + Sadly the jinja template engine is not very flexible - it doesn't support + regular expressions out-of-the-box. Since there might be a slash at the + end of the repository name, we just do a string comparison and kill it. + --> + {% if repo_name == "GitHub" and repo_url %} + {% set repo_id = repo_url | replace("https://github.com/", "") %} + {% if repo_id[-1:] == "/" %} + {% set repo_id = repo_id[:-1] %} + {% endif %} + {% endif %} + + <!-- Backdrop --> + <div class="backdrop"> + <div class="backdrop-paper"></div> + </div> + + <!-- State toggles --> + <input class="toggle" type="checkbox" id="toggle-drawer" /> + <input class="toggle" type="checkbox" id="toggle-search" /> + + <!-- Overlay for expanded drawer --> + <label class="toggle-button overlay" for="toggle-drawer"></label> + + <!-- Header --> + <header class="header"> + {% include "header.html" %} + </header> + + <!-- Main content --> + <main class="main"> + + <!-- + This is a nasty hack that checks whether the content contains a + h1 headline. If it does, the variable h1 is set to true. This is + necessary for correctly rendering the table of contents which is + embedded into the navigation and the actual headline. + --> + {% set h1 = "\x3ch1 id=" in content %} + + <!-- Drawer with navigation --> + <div class="drawer"> + {% include "drawer.html" %} + </div> + + <!-- Article --> + <article class="article"> + <div class="wrapper"> + + <!-- Headline --> + {% if not h1 %} + <h1>{{ page_title | default(site_name, true)}}</h1> + {% endif %} + + <!-- Article content --> + {{ content }} + + <!-- Copyright and theme information --> + <aside class="copyright" role="note"> + {% if copyright %} + {{ copyright }} + {% endif %} + </aside> + + <!-- Footer --> + {% block footer %} + <footer class="footer"> + {% include "footer.html" %} + </footer> + {% endblock %} + </div> + </article> + + <!-- Search results --> + <div class="results" role="status" aria-live="polite"> + <div class="scrollable"> + <div class="wrapper"> + <div class="meta"></div> + <div class="list"></div> + </div> + </div> + </div> + </main> + + <!-- Theme-related and custom javascripts --> + <script> + var base_url = '{{ base_url }}'; + var repo_id = '{{ repo_id }}'; + </script> + <script src="{{ base_url }}/assets/javascripts/application.js"></script> + {% for path in extra_javascript %} + <script src="{{ path }}"></script> + {% endfor %} + + <!-- Google Analytics --> + {% if google_analytics %} + <script> + (function(i,s,o,g,r,a,m){ + i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q|| + []).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g; + m.parentNode.insertBefore(a,m) + })(window, document, + 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); + + /* General initialization */ + ga('create', '{{ google_analytics[0] }}', '{{ google_analytics[1] }}'); + ga('set', 'anonymizeIp', true); + ga('send', 'pageview'); + + /* Track outbound links */ + var buttons = document.querySelectorAll('a'); + Array.prototype.map.call(buttons, function(item) { + if (item.host != document.location.host) { + item.addEventListener('click', function() { + var action = item.getAttribute('data-action') || 'follow'; + ga('send', 'event', 'outbound', action, item.href); + }); + } + }); + + /* Register handler to log search on blur */ + var query = document.querySelector('.query'); + query.addEventListener('blur', function() { + if (this.value) { + var path = document.location.pathname; + ga('send', 'pageview', path + '?q=' + this.value); + } + }); + </script> + {% endif %} + </body> +</html> diff --git a/mkdocs-material/src/drawer.html b/mkdocs-material/src/drawer.html new file mode 100644 index 00000000..ac7f7933 --- /dev/null +++ b/mkdocs-material/src/drawer.html @@ -0,0 +1,109 @@ +<!-- Navigation --> +<nav aria-label="Navigation"> + {% set home = repo_url | default("/", true) %} + + <!-- Project information --> + <a href="{{ home }}" class="project"> + + <!-- Name and logo --> + <div class="banner"> + + <!-- Version --> + {% if config.extra.logo %} + <div class="logo"> + <img src="{{ base_url }}/{{ config.extra.logo }}" /> + </div> + {% endif %} + + <!-- Project name and verison --> + <div class="name"> + <strong> + {{ site_name }} + <span class="version"> + {{ config.extra.version }} + </span> + </strong> + + <!-- Project repository name --> + {% if repo_id %} + <br /> + {{ repo_id }} + {% endif %} + </div> + </div> + </a> + + <!-- Repository and table of contents --> + <div class="scrollable"> + <div class="wrapper"> + + <!-- Repository --> + {% if repo_name == "GitHub" and repo_url %} + <ul class="repo"> + <li class="repo-download"> + {% if config.extra.github and config.extra.github.download_release %} + {% set version = config.extra.version | default("../latest") %} + <a href="{{ repo_url }}/releases/tag/{{ version }}" target="_blank" + title="Download" data-action="download"> + <i class="icon icon-download"></i> Download + </a> + {% else %} + {% set version = config.extra.version | default("master") %} + <a href="{{ repo_url }}/archive/{{ version }}.zip" target="_blank" + title="Download" data-action="download"> + <i class="icon icon-download"></i> Download + </a> + {% endif %} + </li> + <li class="repo-stars"> + <a href="{{ repo_url }}/stargazers" target="_blank" + title="Stargazers" data-action="star"> + <i class="icon icon-star"></i> Stars + <span class="count">–</span> + </a> + </li> + </ul> + <hr /> + {% endif %} + + <!-- Table of contents --> + <div class="toc"> + <ul> + {% for nav_item in nav %} + {% include "nav.html" %} + {% endfor %} + </ul> + + <!-- Author-related links --> + {% if config.extra.author %} + <hr /> + <span class="section">The author</span> + <ul> + + <!-- Twitter --> + {% if config.extra.author.twitter %} + {% set author = config.extra.author.twitter %} + <li> + <a href="https://twitter.com/{{ author }}" target="_blank" + title="@{{ author }} on Twitter"> + @{{ author }} on Twitter + </a> + </li> + {% endif %} + + <!-- GitHub --> + {% if config.extra.author.github %} + {% set author = config.extra.author.github %} + <li> + <a href="https://github.com/{{ author }}" target="_blank" + title="@{{ author }} on GitHub"> + @{{ author }} on GitHub + </a> + </li> + {% endif %} + </ul> + {% endif %} + </div> + </div> + </div> +</nav>
\ No newline at end of file diff --git a/mkdocs-material/src/footer.html b/mkdocs-material/src/footer.html new file mode 100644 index 00000000..01251554 --- /dev/null +++ b/mkdocs-material/src/footer.html @@ -0,0 +1,48 @@ +<!-- Previous and next page --> +{% if include_next_prev %} + <nav class="pagination" aria-label="Footer"> + + <!-- Previous page --> + <div class="previous"> + {% if previous_page %} + <a href="{{ previous_page.url }}" title="{{ previous_page.title }}"> + <span class="direction"> + {{ config.extra.get("i18n", {}).prev | default("Previous") }} + </span> + <div class="page"> + <div class="button button-previous" + role="button" aria-label="Previous"> + <i class="icon icon-back"></i> + </div> + <div class="stretch"> + <div class="title"> + {{ previous_page.title }} + </div> + </div> + </div> + </a> + {% endif %} + </div> + + <!-- Next page --> + <div class="next"> + {% if next_page %} + <a href="{{ next_page.url }}" title="{{ next_page.title }}"> + <span class="direction"> + {{ config.extra.get("i18n", {}).next | default("Next") }} + </span> + <div class="page"> + <div class="stretch"> + <div class="title"> + {{ next_page.title }} + </div> + </div> + <div class="button button-next" role="button" aria-label="Next"> + <i class="icon icon-forward"></i> + </div> + </div> + </a> + {% endif %} + </div> + </nav> +{% endif %}
\ No newline at end of file diff --git a/mkdocs-material/src/header.html b/mkdocs-material/src/header.html new file mode 100644 index 00000000..dc2a0e43 --- /dev/null +++ b/mkdocs-material/src/header.html @@ -0,0 +1,84 @@ +<!-- Top-level navigation --> +<nav aria-label="Header"> + + <!-- Default bar --> + <div class="bar default"> + + <!-- Toggle drawer --> + <div class="button button-menu" role="button" aria-label="Menu"> + <label class="toggle-button icon icon-menu" for="toggle-drawer"> + <span></span> + </label> + </div> + + <!-- Page title --> + <div class="stretch"> + <div class="title"> + {% if current_page %} + <span class="path"> + {% for doc in current_page.ancestors %} + {% if doc.link %} + <a href="{{ doc.link | e }}">{{ doc.title }}</a> + <i class="icon icon-link"></i> + {% else %} + {{ doc.title }} <i class="icon icon-link"></i> + {% endif %} + {% endfor %} + </span> + {% endif %} + {{ page_title | default(site_name, true) }} + </div> + </div> + + <!-- Twitter --> + {% if config.extra.get("author", {}).twitter %} + {% set author = config.extra.author.twitter %} + <div class="button button-twitter" role="button" aria-label="Twitter"> + <a href="https://twitter.com/{{ author }}" + title="@{{ author }} on Twitter" target="_blank" + class="toggle-button icon icon-twitter"></a> + </div> + {% endif %} + + <!-- GitHub --> + {% if config.extra.get("author", {}).github %} + {% set author = config.extra.author.github %} + <div class="button button-github" role="button" aria-label="GitHub"> + <a href="https://github.com/{{ author }}" + title="@{{ author }} on GitHub" target="_blank" + class="toggle-button icon icon-github"></a> + </div> + {% endif %} + + <!-- Open search --> + <div class="button button-search" role="button" aria-label="Search"> + <label class="toggle-button icon icon-search" title="Search" + for="toggle-search"></label> + </div> + </div> + + <!-- Search bar --> + <div class="bar search"> + + <!-- Close search --> + <div class="button button-close" role="button" aria-label="Close"> + <label class="toggle-button icon icon-back" + for="toggle-search"></label> + </div> + + <!-- Search form --> + <div class="stretch"> + <div class="field"> + <input class="query" type="text" placeholder="Search" + autocapitalize="off" autocorrect="off" autocomplete="off" + spellcheck="false" /> + </div> + </div> + + <!-- Empty search --> + <div class="button button-reset" role="button" aria-label="Search"> + <button class="toggle-button icon icon-close" + id="reset-search"></button> + </div> + </div> +</nav>
\ No newline at end of file diff --git a/mkdocs-material/src/nav.html b/mkdocs-material/src/nav.html new file mode 100644 index 00000000..1d70b9fc --- /dev/null +++ b/mkdocs-material/src/nav.html @@ -0,0 +1,51 @@ +<!-- Render sections --> +{% if nav_item.children %} + <li> + <span class="section">{{ nav_item.title }}</span> + <ul> + + <!-- Render pages of section --> + {% for nav_item in nav_item.children %} + {% include "nav.html" %} + {% endfor %} + </ul> + </li> + +<!-- Render page link --> +{% else %} + <li> + <a class="{% if nav_item.active %}current{% endif %}" + title="{{ nav_item.title }}" href="{{ nav_item.url }}" > + {{ nav_item.title }} + </a> + + <!-- Expand active pages --> + {% if nav_item == current_page %} + + <!-- + The top-level anchor must be skipped if the article contains a h1 + headline, since it would be redundant to the link to the current page + that is located just above the anchor. Therefore we directly continue + with the children of the anchor. + --> + {% if h1 %} + {% set toc = (toc | first).children %} + {% endif %} + + <!-- Render anchors of active page --> + {% if toc and (toc | first) %} + <ul> + {% for toc_item in toc %} + + <!-- Render anchor --> + <li class="anchor"> + <a title="{{ toc_item.title }}" href="{{ toc_item.url }}"> + {{ toc_item.title }} + </a> + </li> + {% endfor %} + </ul> + {% endif %} + {% endif %} + </li> +{% endif %}
\ No newline at end of file |
