From 2798431b1b35f7125d83960558ddf361be0119a3 Mon Sep 17 00:00:00 2001 From: ThrillerAtPlay Date: Sun, 26 Apr 2015 18:28:22 -0400 Subject: [PATCH 1/5] initial Slate theme --- theme-slate/script.js | 195 +++++++++ theme-slate/style.css | 950 +++++++++++++++++++++++++++++++++++++++++ theme-slate/style.styl | 705 ++++++++++++++++++++++++++++++ 3 files changed, 1850 insertions(+) create mode 100644 theme-slate/script.js create mode 100644 theme-slate/style.css create mode 100644 theme-slate/style.styl diff --git a/theme-slate/script.js b/theme-slate/script.js new file mode 100644 index 0000000..ab7eb2d --- /dev/null +++ b/theme-slate/script.js @@ -0,0 +1,195 @@ +/* + The MIT License (MIT) + + Copyright (c) <2013> + + 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 NONINFRINGEMENT. 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. +*/ + +if ( typeof Object.create !== 'function' ) { + Object.create = function( obj ) { + function F() {} + F.prototype = obj; + return new F(); + }; +} + +(function( $, window, document, undefined ) { + "use strict"; + + var Anchorific = { + init: function( options, elem ) { + var self = this; + + self.elem = elem; + self.$elem = $( elem ); + + self.opt = $.extend( {}, this.opt, options ); + + self.headers = self.$elem.find( 'h1, h2, h3' ); + + // Fix bug #1 + if ( self.headers.length !== 0 ) { + self.first = parseInt( self.headers.prop( 'nodeName' ).substring( 1 ), null ); + } + + if ( self.opt.spy ) { + self.spy(); + } + + if ( self.opt.top ) { + self.back(); + } + }, + + opt: { + speed: 200, // speed of sliding back to top + top: '.top', // back to top button or link class + spy: true, // scroll spy + spyOffset: !0 // specify heading offset for spy scrolling + }, + + back: function() { + var self = this; + + $( self.opt.top ).on( 'click', function( e ) { + e.preventDefault(); + + $( 'body, html' ).animate({ + 'scrollTop': 0 + }, self.opt.speed ); + }); + }, + + top: function( that ) { + var self = this, top = self.opt.top, back; + + if ( top !== false ) { + back = ( $( that ).scrollTop() > 200 ) ? $( top ).fadeIn() : $( top ).fadeOut(); + } + }, + + spy: function() { + var self = this, prevAhref, currAhref, current, list, top, prevList; + + $( window ).scroll( function( e ) { + // show links back to top + self.top( this ); + // get all the header on top of the viewport + current = self.headers.map( function( e ) { + if ( $( this ).offset().top !==0 && ( $( this ).offset().top - $( window ).scrollTop() ) < self.opt.spyOffset ) { + return this; + } + }); + // get only the latest header on the viewport + + current = $( current ).eq( current.length - 1 ); + + if ( current && current.length ) { + // get all li tag that contains href of # ( all the parents ) + + list = $( '#root-item li:has(a[href="#' + current.attr( 'id' ) + '"])' ); + currAhref = $(list).find( 'a[href="#' + current.attr( 'id' ) + '"]' ); + + if ( prevList !== undefined ) { + prevList.removeClass( 'active' ); + } + if ( prevAhref !== undefined ) { + prevAhref.removeClass( 'current' ); + } + + list.addClass( 'active' ); + currAhref.addClass( 'current' ); + + prevAhref = currAhref; + prevList = list; + } + }); + } + }; + + $.fn.anchorific = function( options ) { + return this.each(function() { + if ( ! $.data( this, 'anchorific' ) ) { + var anchor = Object.create( Anchorific ); + + anchor.init( options, this ); + + $.data( this, 'anchorific', anchor ); + } + }); + }; + +})( jQuery, window, document ); + +// Flatdoc script +(function($) { + var $window = $(window); + var $document = $(document); + + $document.on('flatdoc:ready', function() { + $('.content').anchorific() ; + }); + + /* + * Sidebar stick. + */ + + $(function() { + var $sidebar = $('.menubar'); + var $header = $('.header'); + + $window + .on('resize.sidestick', function() { + $sidebar.removeClass('fixed'); + $window.trigger('scroll.sidestick'); + }) + .on('scroll.sidestick', function() { + var scrollY = $window.scrollTop(); + var elTop = $header.offset().top+$header.height(); + $sidebar.toggleClass('fixed', (scrollY >= elTop)); + }) + .trigger('resize.sidestick'); + }); + + /* + * Title card. + */ + + $(function() { + var $card = $('.title-card'); + if (!$card.length) return; + + var $header = $('.header'); + var headerHeight = $header.length ? $header.outerHeight() : 0; + + $window + .on('resize.title-card', function() { + var windowWidth = $window.width(); + + if (windowWidth < 480) { + $card.css('height', ''); + } else { + var height = $window.height(); + $card.css('height', height - headerHeight); + } + }) + .trigger('resize.title-card'); + }); +})(jQuery); diff --git a/theme-slate/style.css b/theme-slate/style.css new file mode 100644 index 0000000..48993a5 --- /dev/null +++ b/theme-slate/style.css @@ -0,0 +1,950 @@ +/* ---------------------------------------------------------------------------- + * Fonts + */ +@import url("//fonts.googleapis.com/css?family=Montserrat:700|Open+Sans:300"); +/* ---------------------------------------------------------------------------- + * Base + */ +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, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-family: inherit; + font-size: 100%; + vertical-align: baseline; +} +body { + line-height: 1; + color: #000; + background: #fff; +} +ol, +ul { + list-style: none; +} +table { + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; +} +caption, +th, +td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +a img { + border: none; +} +html, +body { + height: 100%; +} +html { + overflow-x: hidden; +} +body, +td, +textarea, +input { + font-family: Helvetica Neue, Open Sans, sans-serif; + line-height: 1.6; + font-size: 13px; + color: #333; +} +@media (max-width: 480px) { + body, + td, + textarea, + input { + font-size: 12px; + } +} +a { + color: #2badad; + text-decoration: none; +} +a:hover { + color: #228a8a; +} +/* ---------------------------------------------------------------------------- + * Content styling + */ +.content p, +.content ul, +.content ol, +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6, +.content pre, +.content blockquote { + padding: 10px 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6 { + font-weight: bold; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; +} +.content pre { + font-family: Menlo, monospace; +} +.content ul > li { + list-style-type: disc; +} +.content ol > li { + list-style-type: decimal; +} +.content ul, +.content ol { + margin-left: 20px; +} +.content ul > li { + list-style-type: none; + position: relative; +} +.content ul > li:before { + content: ''; + display: block; + position: absolute; + left: -17px; + top: 7px; + width: 5px; + height: 5px; + -webkit-border-radius: 4px; + border-radius: 4px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + background: #fff; + border: solid 1px #9090aa; +} +.content li > :first-child { + padding-top: 0; +} +.content strong, +.content b { + font-weight: bold; +} +.content i, +.content em { + font-style: italic; + color: #9090aa; +} +.content code { + font-family: Menlo, monospace; + background: #eee; + padding: 1px 3px; + font-size: 0.95em; +} +.content pre > code { + display: block; + background: #262626; + color: #ccc; + font-size: 0.85em; + padding: 30px; + letter-spacing: -1px; +} +.content pre > code p { + border-bottom: 1px solid #404040; + background: #262626; + -webkit-border-radius: 5px; + border-radius: 5px; + border-top: 1px solid #000; + padding: 15px; +} +.content table { + margin-top: 10px; + margin-bottom: 10px; + padding: 0; + border-collapse: collapse; + clear: both; +} +.content table tr { + border-top: 1px solid #ddd; + background-color: #fff; + margin: 0; + padding: 0; +} +.content table tr :nth-child(2n) { + background-color: #f8f8f8; +} +.content table tr th { + text-align: auto; + font-weight: bold; + border: 1px solid #ddd; + margin: 0; + padding: 6px 13px; +} +.content table tr td { + text-align: auto; + border: 1px solid #ddd; + margin: 0; + padding: 6px 13px; +} +.content table tr th :first-child, +.content table tr td :first-child { + margin-top: 0; +} +.content table tr th :last-child, +.content table tr td :last-child { + margin-bottom: 0; +} +/* ---------------------------------------------------------------------------- + * Content + */ +.content-root { + min-height: 90%; + position: relative; +} +.content { + padding-top: 30px; + padding-bottom: 40px; + padding-left: 40px; + padding-right: 40px; + zoom: 1; + max-width: 700px; +} +.content:before, +.content:after { + content: ""; + display: table; +} +.content:after { + clear: both; +} +.content blockquote { + float: right; + margin: 0; + padding: 2em 28px; + width: calc(100% - 550px - 1px); + background-color: #262626; + text-shadow: 0 1px 0 rgba(255,255,255,0.5); +} +.content blockquote > p { + background-color: #1c1c1c; + border-bottom: 1px solid #404040; + -webkit-border-radius: 5px; + border-radius: 5px; + border-top: 1px solid #000; + color: #ccc; + padding: 13px; + margin: 0 20px; +} +.content h1, +.content h2, +.content h3 { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: montserrat; + padding-bottom: 0; +} +.content h1 + p, +.content h2 + p, +.content h3 + p, +.content h1 ul, +.content h2 ul, +.content h3 ul, +.content h1 ol, +.content h2 ol, +.content h3 ol { + padding-top: 10px; +} +.content h1, +.content h2 { + text-transform: uppercase; + letter-spacing: 1px; + font-size: 1.5em; +} +.content h3 { + font-size: 1.2em; +} +.content h1, +.content h2, +.content .big-heading, +body.big-h3 .content h3 { + padding-top: 80px; +} +.content h1:before, +.content h2:before, +.content .big-heading:before, +body.big-h3 .content h3:before { + display: block; + content: ''; + background: -webkit-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0)); + background: -moz-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0)); + background: -o-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0)); + background: -ms-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0)); + background: linear-gradient(to right, #dfe2e7 80%, rgba(223,226,231,0)); + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4); + box-shadow: 0 1px 0 rgba(255,255,255,0.4); + height: 1px; + position: relative; + top: -40px; + left: -40px; + width: 550px; +} +@media (max-width: 768px) { + .content h1, + .content h2, + .content .big-heading, + body.big-h3 .content h3 { + padding-top: 40px; + } + .content h1:before, + .content h2:before, + .content .big-heading:before, + body.big-h3 .content h3:before { + background: #dfe2e7; + left: -40px; + top: -20px; + width: 120%; + } +} +.content h4, +.content h5, +.content .small-heading, +body:not(.big-h3) .content h3 { + border-bottom: solid 1px rgba(0,0,0,0.07); + color: #9090aa; + padding-top: 30px; + padding-bottom: 10px; +} +body:not(.big-h3) .content h3 { + font-size: 0.9em; +} +.content h1:first-child { + padding-top: 0; +} +.content h1:first-child, +.content h1:first-child a, +.content h1:first-child a:visited { + color: #333; +} +.content h1:first-child:before { + display: none; +} +@media (max-width: 768px) { + .content h4, + .content h5, + .content .small-heading, + body:not(.big-h3) .content h3 { + padding-top: 20px; + } +} +@media (max-width: 480px) { + .content { + padding: 20px; + padding-top: 40px; + } + .content h4, + .content h5, + .content .small-heading, + body:not(.big-h3) .content h3 { + padding-top: 10px; + } +} +body.no-literate .content blockquote, +body.no-literate .content pre { + background: #333; + border: solid 1px #303030; + border-top: solid 1px #2e2e2e; + border-left: solid 1px #2f2f2f; + display: block; + padding: 10px; + -webkit-border-radius: 2px; + border-radius: 2px; + overflow: auto; + border-color: #ddd; + background: #f3f6fb; +} +body.no-literate .content blockquote, +body.no-literate .content pre { + -webkit-overflow-scrolling: touch; +} +body.no-literate .content blockquote::-webkit-scrollbar, +body.no-literate .content pre::-webkit-scrollbar { + width: 15px; + height: 15px; +} +body.no-literate .content blockquote::-webkit-scrollbar-thumb, +body.no-literate .content pre::-webkit-scrollbar-thumb { + background: #ddd; + -webkit-border-radius: 8px; + border-radius: 8px; + border: solid 4px #333; +} +body.no-literate .content blockquote:hover::-webkit-scrollbar-thumb, +body.no-literate .content pre:hover::-webkit-scrollbar-thumb { + background: #9090aa; + -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); + box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); +} +body.no-literate .content blockquote, +body.no-literate .content pre > blockquote, +body.no-literate .content pre > code { + border: 0; + float: inherit; +} +body.no-literate .content blockquote, +body.no-literate .content pre > blockquote { + width: 100%; +} +body.no-literate .content blockquote > p { + background: transparent; + border: 0; + color: #333; +} +@media (max-width: 1180px) { + .content blockquote, + .content pre > code, + .content pre > blockquote { + zoom: 1; + background: #333; + border: solid 1px #303030; + border-top: solid 1px #2e2e2e; + border-left: solid 1px #2f2f2f; + display: block; + padding: 10px; + -webkit-border-radius: 2px; + border-radius: 2px; + overflow: auto; + background: #f3f6fb; + border-color: #ddd; + color: #ccc; + float: left; + width: 100%; + } + .content blockquote:before, + .content pre > code:before, + .content pre > blockquote:before, + .content blockquote:after, + .content pre > code:after, + .content pre > blockquote:after { + content: ""; + display: table; + } + .content blockquote:after, + .content pre > code:after, + .content pre > blockquote:after { + clear: both; + } + .content blockquote, + .content pre > code, + .content pre > blockquote { + -webkit-overflow-scrolling: touch; + } + .content blockquote::-webkit-scrollbar, + .content pre > code::-webkit-scrollbar, + .content pre > blockquote::-webkit-scrollbar { + width: 15px; + height: 15px; + } + .content blockquote::-webkit-scrollbar-thumb, + .content pre > code::-webkit-scrollbar-thumb, + .content pre > blockquote::-webkit-scrollbar-thumb { + background: #ddd; + -webkit-border-radius: 8px; + border-radius: 8px; + border: solid 4px #333; + } + .content blockquote:hover::-webkit-scrollbar-thumb, + .content pre > code:hover::-webkit-scrollbar-thumb, + .content pre > blockquote:hover::-webkit-scrollbar-thumb { + background: #9090aa; + -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); + box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); + } +} +.button { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: montserrat, sans-serif; + letter-spacing: -1px; + font-weight: bold; + display: inline-block; + padding: 3px 25px; + border: solid 2px #2badad; + -webkit-border-radius: 20px; + border-radius: 20px; + margin-right: 15px; +} +.button, +.button:visited { + background: #2badad; + color: #fff; + text-shadow: none; +} +.button:hover { + border-color: #111; + background: #111; + color: #fff; +} +.button.light, +.button.light:visited { + background: transparent; + color: #9090aa; + border-color: #9090aa; + text-shadow: none; +} +.button.light:hover { + border-color: #9090aa; + background: #9090aa; + color: #fff; +} +.content .button + em { + color: #9090aa; +} +@media (min-width: 1180px) { + body:not(.no-literate) .content-root { + background-color: #333; + -webkit-box-shadow: inset 780px 0 #eaf2f6, inset 781px 0 #dfe2e7, inset 790px 0 5px -10px rgba(0,0,0,0.1); + box-shadow: inset 780px 0 #eaf2f6, inset 781px 0 #dfe2e7, inset 790px 0 5px -10px rgba(0,0,0,0.1); + } + blockquote { + margin-left: 571px; + } +} +@media (min-width: 1180px) { + body:not(.no-literate) .content { + padding-left: 0; + padding-right: 0; + max-width: none; + } + body:not(.no-literate) .content > p, + body:not(.no-literate) .content > ul, + body:not(.no-literate) .content > ol, + body:not(.no-literate) .content > h1, + body:not(.no-literate) .content > h2, + body:not(.no-literate) .content > h3, + body:not(.no-literate) .content > h4, + body:not(.no-literate) .content > h5, + body:not(.no-literate) .content > h6, + body:not(.no-literate) .content > pre, + body:not(.no-literate) .content > blockquote { + width: 550px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding-right: 40px; + padding-left: 40px; + } + body:not(.no-literate) .content > h1, + body:not(.no-literate) .content > h2, + body:not(.no-literate) .content > h3 { + clear: both; + width: 100%; + } + body:not(.no-literate) .content > pre, + body:not(.no-literate) .content > blockquote { + width: calc(100% - 550px - 1px); + float: right; + padding-left: 0; + padding-right: 0; + clear: right; + } + body:not(.no-literate) .content > pre + p, + body:not(.no-literate) .content > blockquote + p, + body:not(.no-literate) .content > pre + ul, + body:not(.no-literate) .content > blockquote + ul, + body:not(.no-literate) .content > pre + ol, + body:not(.no-literate) .content > blockquote + ol, + body:not(.no-literate) .content > pre + h4, + body:not(.no-literate) .content > blockquote + h4, + body:not(.no-literate) .content > pre + h5, + body:not(.no-literate) .content > blockquote + h5, + body:not(.no-literate) .content > pre + h6, + body:not(.no-literate) .content > blockquote + h6 { + clear: both; + } + body:not(.no-literate) .content > pre > blockquote { + width: 100%; + } + body:not(.no-literate) .content > p, + body:not(.no-literate) .content > ul, + body:not(.no-literate) .content > ol, + body:not(.no-literate) .content > h4, + body:not(.no-literate) .content > h5, + body:not(.no-literate) .content > h6 { + float: left; + clear: left; + } + body:not(.no-literate) .content > h4, + body:not(.no-literate) .content > h5, + body:not(.no-literate) .content > .small-heading, + body:not(.big-h3) body:not(.no-literate) .content > h3 { + margin-left: 40px; + width: 470px; + margin-bottom: 3px; + padding-left: 0; + padding-right: 0; + } + body:not(.no-literate) .content > table { + margin-left: 40px; + margin-right: 40px; + max-width: 470px; + } + body:not(.no-literate):not(.big-h3) .content > h3 { + margin-left: 40px; + width: 470px; + margin-bottom: 3px; + padding-left: 0; + padding-right: 0; + } +} +.header { + background: #333; + border-bottom: solid 1px #dfe2e7; + padding: 15px 15px 15px 30px; + zoom: 1; + line-height: 20px; + position: relative; +} +.header:before, +.header:after { + content: ""; + display: table; +} +.header:after { + clear: both; +} +.header .left { + float: left; +} +.header .right { + text-align: right; + position: absolute; + right: 15px; + top: 15px; +} +.header .right iframe { + display: inline-block; + vertical-align: middle; +} +.header h1 { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-weight: bold; + font-family: montserrat, sans-serif; + font-size: 13px; +} +.header h1, +.header h1 a, +.header h1 a:visited { + color: #fff; +} +.header h1 a:hover { + color: #9090aa; +} +.header li a { + font-size: 0.9em; + color: #fff; + display: block; +} +.header li a:hover { + color: #3a3a44; +} +@media (min-width: 480px) { + .header h1 { + float: left; + } + .header ul, + .header li { + display: block; + float: left; + } + .header ul { + margin-left: -15px; + } + .header h1 + ul { + border-left: solid 1px #dfe2e7; + margin-left: 15px; + } + .header li { + border-left: solid 1px rgba(255,255,255,0.5); + border-right: solid 1px #dfe2e7; + } + .header li:last-child { + border-right: 0; + } + .header li a { + padding: 0 15px; + } +} +@media (max-width: 480px) { + .right { + display: none; + } +} +.menubar { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + background-color: #333; + font-size: 0.9em; +} +.menubar .section { + padding: 30px 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.menubar .section + .section { + border-top: solid 1px #dfe2e7; +} +.menubar .section.no-line { + border-top: 0; + padding-top: 0; +} +a.big.button { + display: block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + padding: 10px 20px; + text-align: center; + font-weight: bold; + font-size: 1.1em; + background: transparent; + border: solid 3px #2badad; + -webkit-border-radius: 30px; + border-radius: 30px; + font-family: montserrat, sans-serif; +} +a.big.button, +a.big.button:visited { + color: #2badad; + text-decoration: none; +} +a.big.button:hover { + background: #2badad; +} +a.big.button:hover, +a.big.button:hover:visited { + color: #fff; +} +@media (max-width: 480px) { + .menubar { + padding: 20px; + border-bottom: solid 1px #dfe2e7; + } +} +@media (max-width: 768px) { + .menubar { + display: none; + } +} +@media (min-width: 768px) { + .content-root { + padding-left: 230px; + } + .menubar { + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 230px; + border-right: solid 1px #dfe2e7; + } + .menubar.fixed { + position: fixed; + overflow-y: auto; + } + .menubar.fixed { + -webkit-overflow-scrolling: touch; + } + .menubar.fixed::-webkit-scrollbar { + width: 15px; + height: 15px; + } + .menubar.fixed::-webkit-scrollbar-thumb { + background: #ddd; + -webkit-border-radius: 8px; + border-radius: 8px; + border: solid 4px #fff; + } + .menubar.fixed:hover::-webkit-scrollbar-thumb { + background: #9090aa; + -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); + box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); + } +} +.menubar { + font-size: 0.9em; +} +.menu ul.level-1 > li + li { + margin-top: 20px; +} +.menu a { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + position: relative; + display: block; + padding-top: 1px; + padding-bottom: 1px; +} +.menu a, +.menu a:visited { + color: #fff; +} +.menu a:hover { + color: #ccc; +} +.menu a.level-1 { + font-family: montserrat, sans-serif; + text-transform: uppercase; + font-size: 1.1em; + font-weight: bold; + padding-left: 15px; +} +.menu a.level-1, +.menu a.level-1:visited { + color: #fff; +} +.menu a.level-1:hover { + color: #ccc; +} +.menu a.level-2 { + background-color: #262626; + font-weight: norma; + padding-left: 25px; +} +.menu a.level-3 { + background-color: #262626; + font-weight: normal; + font-size: 0.9em; + padding-left: 35px; +} +.menu a.active { + font-weight: bold !important; +} +.menu a.active, +.menu a.active:visited, +.menu a.active:hover { + color: #fff !important; +} +.menu li.active ul { + display: block; +} +.menu li.active > a { + font-weight: bold !important; +} +.menu li.active > a.current { + background-color: #2467af; +} +.menu li ul.level-1 { + display: block; +} +.menu li ul { + display: none; +} +code .string, +code .number { + color: #3ac; +} +code .init { + color: #383; +} +code .keyword { + font-weight: bold; +} +code .comment { + color: #adadcc; +} +.large-brief .content > h1:first-child + p, +.content > p.brief { + font-size: 1.3em; + font-family: Open Sans, sans-serif; + font-weight: 300; +} +.title-area { + min-height: 100px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + text-align: center; + border-bottom: solid 1px #dfe2e7; + overflow: hidden; +} +.title-area > img.bg { + z-index: 0; + position: absolute; + left: -9999px; +} +.title-area > div { + position: relative; + z-index: 1; +} diff --git a/theme-slate/style.styl b/theme-slate/style.styl new file mode 100644 index 0000000..34b9033 --- /dev/null +++ b/theme-slate/style.styl @@ -0,0 +1,705 @@ +support-for-ie = true + +@import 'nib' + +// Fonts +$body-font = Helvetica Neue, Open Sans, sans-serif +$mono-font = Menlo, monospace + +// Margins +$pad = 40px // Space between things +$sidepad = 30px // Padding to the left of the sidebar +$minipad = 20px // Space for mobile +$vmargin = 10px // Margin between blocks + +// Colors +$slate = #333333 +$grey = #9090aa +$txt = #ccc +$border = #ddd +$accent = #3cc*0.85 +$navlinkbg = #262626 +$nav = #fff +$indicator = #2467af +$line = #e4e7ec * 0.98 +$contentbg = #f3f6fb + +// Misc +$shadow-str = 0.1 + +// Dimensions +$sidebar-width = 230px +$content-width = 550px +$pre-width = 380px + +/* ---------------------------------------------------------------------------- + * Fonts + */ + +@import url('//fonts.googleapis.com/css?family=Montserrat:700|Open+Sans:300') + +// ---------------------------------------------------------------------------- +// Mixins + +scrollbar($bg=white) + & + -webkit-overflow-scrolling: touch + &::-webkit-scrollbar + width: 15px + height: 15px + &::-webkit-scrollbar-thumb + background: $border + border-radius: 8px + border: solid 4px $bg + &:hover::-webkit-scrollbar-thumb + background: $grey + box-shadow: inset 2px 2px 3px rgba(0, 0, 0, 0.2) + +antialias() + -webkit-font-smoothing: antialiased + text-rendering: optimizeLegibility + +/* ---------------------------------------------------------------------------- + * Base + */ + +global-reset() + +html, body + height: 100% + +html + overflow-x: hidden + +body, td, textarea, input + font-family: $body-font + line-height: 1.6 + font-size: 13px + color:$slate + + @media (max-width: 480px) /* Mobile */ + font-size: 12px + +a + color: $accent + text-decoration: none + &:hover + color: $accent * 0.8 + +/* ---------------------------------------------------------------------------- + * Content styling + */ + +.content + p, ul, ol, h1, h2, h3, h4, h5, h6, pre, blockquote + padding: $vmargin 0 + box-sizing: border-box + + h1, h2, h3, h4, h5, h6 + font-weight: bold + antialias() + + pre + font-family: $mono-font + + ul > li + list-style-type: disc + + ol > li + list-style-type: decimal + + ul, ol + margin-left: 20px + + ul > li + list-style-type: none + position: relative + &:before + content: '' + display: block + absolute: left -17px top 7px + width: 5px + height: 5px + border-radius: 4px + box-sizing: border-box + background: white + border: solid 1px $grey + + li > :first-child + padding-top: 0 + + strong, b + font-weight: bold + + i, em + font-style: italic + color: $grey + + code + font-family: $mono-font + background: #eee + padding: 1px 3px + font-size: 0.95em + + pre > code + display: block + background: $navlinkbg + color: $txt + font-size: 0.85em + padding: $sidepad + letter-spacing: -1px + + p + border-bottom: 1px solid #404040 + background: $navlinkbg + border-radius: 5px + border-top: 1px solid black + padding: 15px + + table + + margin-top: $vmargin + margin-bottom: $vmargin + padding: 0 + border-collapse: collapse + clear: both + + tr + border-top: 1px solid $border + background-color: white + margin: 0 + padding: 0 + + :nth-child(2n) + background-color: #f8f8f8 + + th + text-align: auto; + font-weight: bold + border: 1px solid $border + margin: 0 + padding: 6px 13px + + td + text-align: auto; + border: 1px solid $border + margin: 0 + padding: 6px 13px + + th, td + :first-child + + margin-top: 0; + :last-child + margin-bottom: 0; + + + + + +/* ---------------------------------------------------------------------------- + * Content + */ + +.content-root + min-height: 90% + position: relative + +.content + padding-top: $pad - $vmargin + padding-bottom: $pad + padding-left: $pad + padding-right: $pad + clearfix() + + max-width: 700px + + blockquote + float: right; + margin: 0; + padding: 2em 28px; + width: "calc(100% - %s - 1px)" % $content-width + background-color: $navlinkbg + text-shadow: 0 1px 0 rgba(white, 0.5) + > p + background-color: #1c1c1c; + border-bottom: 1px solid #404040; + border-radius: 5px; + border-top: 1px solid black; + color: $txt; + padding: 13px; + margin: 0 20px; + + h1, h2, h3 + antialias() + font-family: montserrat + padding-bottom: 0 + + + p, ul, ol + padding-top: 10px + + h1, h2 + text-transform: uppercase + letter-spacing: 1px + font-size: 1.5em + + h3 + font-size: 1.2em + + // Lines + h1, h2, .big-heading + padding-top: $pad * 2 + &:before + display: block + content: '' + background: linear-gradient(left, rgba($line, 1.0) 80%, rgba($line, 0.0)) + box-shadow: 0 1px 0 rgba(white, 0.4) + height: 1px + position: relative + top: $pad * -1 + left: $pad * -1 + width: $content-width + + @media (max-width: 768px) /* Mobile and tablet */ + padding-top: $minipad * 2 + &:before + background: $line + left: $pad * -1 + top: $minipad * -1 + width: 120% + + // Small headings + h4, h5, .small-heading + border-bottom: solid 1px rgba(black, 0.07) + color: $grey + padding-top: $vmargin * 3 + padding-bottom: 10px + + body:not(.big-h3) & h3 + @extends .content .small-heading + font-size: 0.9em + + body.big-h3 & h3 + @extends .content .big-heading + + h1:first-child + padding-top: 0 + &, a, a:visited + color: $slate + &:before + display: none + +@media (max-width: 768px) /* Tablet */ + .content + h4, h5, .small-heading, body:not(.big-h3) & h3 + padding-top: $vmargin * 2 + +@media (max-width: 480px) /* Mobile */ + .content + padding: $minipad + padding-top: $minipad * 2 + + h4, h5, .small-heading, body:not(.big-h3) & h3 + padding-top: $vmargin + +// ---------------------------------------------------------------------------- +// Code blocks + +inset-box() + background: $slate + border: solid 1px $slate*0.95 + border-top: solid 1px $slate*0.9 + border-left: solid 1px $slate*0.93 + display: block + padding: 10px + border-radius: 2px + + overflow: auto + scrollbar($slate) + +body.no-literate .content blockquote, +body.no-literate .content pre + inset-box() + border-color: $border + background: $contentbg +body.no-literate .content blockquote, +body.no-literate .content pre > blockquote, +body.no-literate .content pre > code + border: 0 + float: inherit + +body.no-literate .content blockquote, +body.no-literate .content pre > blockquote + width: 100% + +body.no-literate .content blockquote > p + background:transparent + border: 0 + color: $slate + + +@media (max-width: 1180px) /* Small desktop */ + .content blockquote, + .content pre > code + .content pre > blockquote + clearfix() + inset-box() + background: $contentbg + border-color: $border + color: $txt + float: left; + width: 100% + +// ---------------------------------------------------------------------------- +// Buttons + +.button + antialias() + font-family: montserrat, sans-serif + letter-spacing: -1px + font-weight: bold + + display: inline-block + padding: 3px 25px + + border: solid 2px $accent + border-radius: 20px + + margin-right: 15px + + &, &:visited + background: $accent + color: white + text-shadow: none + + &:hover + border-color: #111 + background: #111 + color: white + + &.light + &, &:visited + background: transparent + color: $grey + border-color: $grey + text-shadow: none + + &:hover + border-color: $grey + background: $grey + color: white + +.content + .button + em + color: $grey + + +// ---------------------------------------------------------------------------- +// Literate mode content + +@media (min-width: 1180px) /* Big desktop */ + body:not(.no-literate) + .content-root + background-color: $slate + $w = ($sidebar-width + $content-width) + box-shadow: inset $w 0 #eaf2f6, inset ($w + 1) 0 $line, inset ($w + 10) 0 5px -10px rgba(black, $shadow-str) + blockquote + margin-left: $content-width + $minipad + 1 + +// Literate mode +@media (min-width: 1180px) /* Big desktop */ + small-heading() + margin-left: $pad + width: $content-width - $pad * 2 + margin-bottom: 3px + + padding-left: 0 + padding-right: 0 + + body:not(.no-literate) + .content + padding-left: 0 + padding-right: 0 + max-width: none + + > + p, ul, ol, h1, h2, h3, h4, h5, h6, pre, blockquote + width: $content-width + box-sizing: border-box + padding-right: $pad + padding-left: $pad + h1, h2, h3 + clear: both + width: 100% + pre, blockquote + width: "calc(100% - %s - 1px)" % $content-width + float: right + padding-left: 0 + padding-right: 0 + clear: right + + + p, ul, ol, h4, h5, h6 + clear: both + pre > blockquote + width: 100% + p, ul, ol, h4, h5, h6 + float: left + clear: left + + h4, h5, .small-heading, body:not(.big-h3) & h3 + small-heading() + + table + margin-left: $pad + margin-right: $pad + max-width: $content-width - $pad*2 + + body:not(.no-literate):not(.big-h3) + .content > h3 + small-heading() + +// ---------------------------------------------------------------------------- +// Header + +.header + background: $slate + //text-shadow: 0 1px 0 rgba(white, 0.5) + border-bottom: solid 1px $line + padding: 15px 15px 15px $sidepad + clearfix() + + line-height: 20px + position: relative + + .left + float: left + + .right + text-align: right + position: absolute + right: 15px + top: 15px + + iframe + display: inline-block + vertical-align: middle + + h1 + antialias() + font-weight: bold + font-family: montserrat, sans-serif + font-size: 13px + + &, a, a:visited + color: $nav + a:hover + color: $grey + + li a + font-size: 0.9em + color: $nav + display: block + + &:hover + color: $grey*0.4 + + @media (min-width: 480px) /* Tablet & Desktop */ + h1 + float: left + + ul, li + display: block + float: left + + ul + margin-left: -15px + + h1 + ul + border-left: solid 1px $line + margin-left: 15px + + li + border-left: solid 1px rgba(white, 0.5) + border-right: solid 1px $line + &:last-child + border-right: 0 + + li a + padding: 0 15px + +@media (max-width: 480px) /* Mobile */ + // Hide extra stuff on mobile + .right + display: none + +// ---------------------------------------------------------------------------- +// Sidebar + +.menubar + antialias() + background-color: $slate + font-size: .9em + .section + padding: $sidepad 0 + box-sizing: border-box + + .section + .section + border-top: solid 1px $line + + .section.no-line + border-top: 0 + padding-top: 0 + +a.big.button + display: block + box-sizing: border-box + width: 100% + padding: 10px 20px + text-align: center + + font-weight: bold + font-size: 1.1em + + background: transparent + border: solid 3px $accent + border-radius: 30px + font-family: montserrat, sans-serif + + &, &:visited + color: $accent + text-decoration: none + + &:hover + background: $accent + &, &:visited + color: white + +@media (max-width: 480px) /* Mobile */ + .menubar + padding: $minipad + border-bottom: solid 1px $line + +@media (max-width: 768px) /* Mobile and tablet */ + .menubar + display: none + +@media (min-width: 768px) /* Desktop */ + .content-root + padding-left: $sidebar-width + + .menubar + position: absolute + left: 0 + top: 0 + bottom: 0 + width: $sidebar-width + border-right: solid 1px $line + + .menubar.fixed + position: fixed + + scrollbar() + overflow-y: auto + +.menubar + font-size: 0.9em + +// Menu items +.menu + ul.level-1 > li + li + margin-top: 20px + + a + box-sizing: border-box + position: relative + + display: block + padding-top: 1px + padding-bottom: 1px + + &, &:visited + color: $nav + &:hover + color: $nav*0.8 + + a.level-1 + font-family: montserrat, sans-serif + text-transform: uppercase + font-size: 1.1em + font-weight: bold + padding-left: 15px + &, &:visited + color: $nav + &:hover + color: $nav*0.8 + + a.level-2 + background-color: $navlinkbg + font-weight: norma + padding-left: 25px + + a.level-3 + background-color: $navlinkbg + font-weight: normal + font-size: 0.9em + padding-left: 35px + + a.active + &, &:visited, &:hover + color: $nav !important + font-weight: bold !important + + li.active + ul + display: block; + > a + font-weight: bold !important + > a.current + background-color: $indicator + li ul.level-1 + display: block; + li ul + display: none; + +// ---------------------------------------------------------------------------- +// Syntax highlighting + +code + .string, .number + color: #3ac + .init + color: #383 + .keyword + font-weight: bold + .comment + color: $grey * 1.2 + +// ---------------------------------------------------------------------------- + +.content + .large-brief & > h1:first-child + p, + > p.brief + font-size: 1.3em + font-family: Open Sans, sans-serif + font-weight: 300 + +// ---------------------------------------------------------------------------- + +.title-area + min-height: 100px + box-sizing: border-box + antialias() + text-align: center + border-bottom: solid 1px $line + overflow: hidden + + > img.bg + z-index: 0 + + // Start it off screen + position: absolute + left: -9999px + + > div + position: relative + z-index: 1 From 081edf15625ac75dfd4e0e3ddffd8a2d243888fe Mon Sep 17 00:00:00 2001 From: ThrillerAtPlay Date: Tue, 28 Apr 2015 01:04:35 -0400 Subject: [PATCH 2/5] fixed scrollspy navigation hiccups --- theme-slate/script.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/theme-slate/script.js b/theme-slate/script.js index ab7eb2d..10a555b 100644 --- a/theme-slate/script.js +++ b/theme-slate/script.js @@ -47,6 +47,9 @@ if ( typeof Object.create !== 'function' ) { // Fix bug #1 if ( self.headers.length !== 0 ) { self.first = parseInt( self.headers.prop( 'nodeName' ).substring( 1 ), null ); + + $( '#root-item li:has(a[href="#' + $(self.headers[0]).attr('id') + '"])' ).addClass( 'active' ); + $( '#root-item a[href="#' + $(self.headers[0]).attr('id') + '"]' ).addClass( 'current' ); } if ( self.opt.spy ) { @@ -103,22 +106,23 @@ if ( typeof Object.create !== 'function' ) { if ( current && current.length ) { // get all li tag that contains href of # ( all the parents ) - list = $( '#root-item li:has(a[href="#' + current.attr( 'id' ) + '"])' ); - currAhref = $(list).find( 'a[href="#' + current.attr( 'id' ) + '"]' ); - - if ( prevList !== undefined ) { - prevList.removeClass( 'active' ); + currAhref = $(list).find( 'a[href="#' + current.attr( 'id' ) + '"]' ); + + if (list.length !==0) { + if (prevList !== undefined) { + prevList.removeClass( 'active' ); + } + list.addClass( 'active' ); + prevList = list; } - if ( prevAhref !== undefined ) { - prevAhref.removeClass( 'current' ); + if (currAhref.length !==0) { + if (prevAhref !== undefined) { + prevAhref.removeClass( 'current' ); + } + currAhref.addClass( 'current' ); + prevAhref = currAhref; } - - list.addClass( 'active' ); - currAhref.addClass( 'current' ); - - prevAhref = currAhref; - prevList = list; } }); } From 768d07d987a456d868f5a5a9e47d2cbed1f6dd44 Mon Sep 17 00:00:00 2001 From: ThrillerAtPlay Date: Tue, 28 Apr 2015 23:04:01 -0400 Subject: [PATCH 3/5] rotate zebra --- theme-slate/style.css | 2 +- theme-slate/style.styl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/theme-slate/style.css b/theme-slate/style.css index 48993a5..d5972f3 100644 --- a/theme-slate/style.css +++ b/theme-slate/style.css @@ -236,7 +236,7 @@ a:hover { margin: 0; padding: 0; } -.content table tr :nth-child(2n) { +.content table tr:nth-child(2n) { background-color: #f8f8f8; } .content table tr th { diff --git a/theme-slate/style.styl b/theme-slate/style.styl index 34b9033..29d45aa 100644 --- a/theme-slate/style.styl +++ b/theme-slate/style.styl @@ -170,7 +170,7 @@ a margin: 0 padding: 0 - :nth-child(2n) + &:nth-child(2n) background-color: #f8f8f8 th From e2ae115464ecb2a0c44a4c83e48fd2b380f303bf Mon Sep 17 00:00:00 2001 From: ThrillerAtPlay Date: Sun, 1 Nov 2015 01:15:17 -0400 Subject: [PATCH 4/5] fix always selecting first header on relaod --- theme-slate/script.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/theme-slate/script.js b/theme-slate/script.js index 10a555b..7fac4b7 100644 --- a/theme-slate/script.js +++ b/theme-slate/script.js @@ -47,9 +47,6 @@ if ( typeof Object.create !== 'function' ) { // Fix bug #1 if ( self.headers.length !== 0 ) { self.first = parseInt( self.headers.prop( 'nodeName' ).substring( 1 ), null ); - - $( '#root-item li:has(a[href="#' + $(self.headers[0]).attr('id') + '"])' ).addClass( 'active' ); - $( '#root-item a[href="#' + $(self.headers[0]).attr('id') + '"]' ).addClass( 'current' ); } if ( self.opt.spy ) { @@ -100,9 +97,9 @@ if ( typeof Object.create !== 'function' ) { return this; } }); - // get only the latest header on the viewport - current = $( current ).eq( current.length - 1 ); + // get only the latest header on the viewport + current = $( current ).last() || self.headers [0]; if ( current && current.length ) { // get all li tag that contains href of # ( all the parents ) From ceca9174211df1dee1f5ef481341e1e77ec23480 Mon Sep 17 00:00:00 2001 From: ThrillerAtPlay Date: Sun, 1 Nov 2015 14:21:01 -0500 Subject: [PATCH 5/5] fix a few styles --- theme-slate/style.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/theme-slate/style.css b/theme-slate/style.css index d5972f3..8daa16a 100644 --- a/theme-slate/style.css +++ b/theme-slate/style.css @@ -189,7 +189,7 @@ a:hover { background: #fff; border: solid 1px #9090aa; } -.content li > :first-child { +.content li > *:first-child { padding-top: 0; } .content strong, @@ -252,12 +252,12 @@ a:hover { margin: 0; padding: 6px 13px; } -.content table tr th :first-child, -.content table tr td :first-child { +.content table tr th:first-child, +.content table tr td:first-child { margin-top: 0; } -.content table tr th :last-child, -.content table tr td :last-child { +.content table tr th:last-child, +.content table tr td:last-child { margin-bottom: 0; } /* ----------------------------------------------------------------------------