From 74ee0cf6bc85c938e735aab50dcebd3a05da3652 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 18 Dec 2016 10:37:34 +0800 Subject: [PATCH 1/4] Add table style --- src/themes/basic/_layout.css | 30 +++++++++++++++++++++++++++++- src/themes/vue.css | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/themes/basic/_layout.css b/src/themes/basic/_layout.css index ddcead4de..f79dd3129 100644 --- a/src/themes/basic/_layout.css +++ b/src/themes/basic/_layout.css @@ -235,6 +235,33 @@ main { } } +.markdown-section table { + display: block; + width: 100%; + overflow: auto; + border-spacing: 0; + border-collapse: collapse; +} + +.markdown-section th { + font-weight: bold; + padding: 6px 13px; + border: 1px solid #ddd; +} + +.markdown-section td { + padding: 6px 13px; + border: 1px solid #ddd; +} + +.markdown-section tr { + background-color: #fff; + border-top: 1px solid #ccc; + &:nth-child(2n) { + background-color: #f8f8f8; + } +} + body.close { .sidebar { transform: translateX(-$sidebar-width); @@ -246,11 +273,12 @@ body.close { } @media (max-width: 600px) { - nav, .github-corner, .sidebar-toggle, .sidebar { + .github-corner, .sidebar-toggle, .sidebar { position: fixed; } nav { + position: static; margin-top: 16px; } diff --git a/src/themes/vue.css b/src/themes/vue.css index efe017839..a6a41896b 100644 --- a/src/themes/vue.css +++ b/src/themes/vue.css @@ -277,7 +277,7 @@ code .token { pre::after { color: #ccc; content: attr(data-lang); - font-size: 0.75em; + font-size: 0.6em; font-weight: 600; height: 15px; line-height: 15px; From 3af5ca5cd44bfe73b0cb1a46e50ed05ec729d7ce Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 18 Dec 2016 10:49:21 +0800 Subject: [PATCH 2/4] Correct calculation of whether the mobile browser --- CHANGELOG.md | 8 ++++++++ src/util.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84205b574..92f71fcdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.1.5 +### Features +- Add table style + +### Bug fixes +- Not fixed position of hte navbar in the mobile browser +- Correct calculation of whether the mobile browser + ## 1.1.4 ### Bug fixes - Fixed chinese auchor link diff --git a/src/util.js b/src/util.js index 013b27698..c93b5888d 100644 --- a/src/util.js +++ b/src/util.js @@ -97,6 +97,6 @@ export function getRoute () { } export function isMobile () { - return /mobile/i.test(navigator.userAgent) + return document.body.clientWidth <= 600 } From 3fbcd876aea2c6f3c813cac59565dda4ab56fe6f Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 18 Dec 2016 10:49:56 +0800 Subject: [PATCH 3/4] bump 1.1.5 --- lib/docsify.js | 2 +- lib/docsify.min.js | 4 ++-- lib/themes/buble.css | 2 +- lib/themes/pure.css | 2 +- lib/themes/vue.css | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/docsify.js b/lib/docsify.js index ed288dc0f..28fffa909 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -106,7 +106,7 @@ function getRoute () { } function isMobile () { - return /mobile/i.test(navigator.userAgent) + return document.body.clientWidth <= 600 } /** diff --git a/lib/docsify.min.js b/lib/docsify.min.js index 5133294ad..acca3bc49 100644 --- a/lib/docsify.min.js +++ b/lib/docsify.min.js @@ -1,2 +1,2 @@ -var Docsify=function(){"use strict";function e(e,t,n){void 0===t&&(t="GET");var r=new XMLHttpRequest;return r.open(t,e),r.send(),{then:function(e,t){void 0===t&&(t=function(){}),n&&(r.addEventListener("progress",n),r.addEventListener("loaded",n)),r.addEventListener("error",t),r.addEventListener("load",function(n){var r=n.target;r.status>=400?t(r):e(r.response)})},abort:function(){return 4!==r.readyState&&r.abort()}}}function t(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,a=i-1;i>t||(r[a]?(r[a].children=r[a].children||[],r[a].children.push(e)):n.push(e),r[i]=e)}),n}function n(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function r(e){return null===e||void 0===e}function i(){var e=window.location;if(_===e.hash&&!r(S))return S;var t=e.hash.match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,S=t,_=e.hash,t}function a(){return/mobile/i.test(navigator.userAgent)}function s(){function e(){for(var e=0,r=t.length;e10){var o=n[a.id];if(!o||o===i)return;return i&&i.setAttribute("class",""),o.setAttribute("class","active"),void(i=o)}}}if(!a()){for(var t=document.querySelectorAll(".anchor"),n={},r=document.querySelectorAll(".sidebar li"),i=null,s=0,o=r.length;s\n \n '):""}function h(){return'
\n \n
\n
\n
\n
'}function d(e){return e?'':""}function f(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='
  • '+e.title+"
  • ",e.children&&(t+='
    • '+f(e.children)+"
    ")}),t):""}function m(e,t){var n=document.querySelector("nav")||document.createElement("nav");e[t?"outerHTML":"innerHTML"]=d($.sidebarToggle)+g($.repo)+h(),document.body.insertBefore(n,document.body.children[0]),u("button.sidebar-toggle")}function b(e){q("article",e?C(e):"not found"),k.rendered||k(null,$),y.rendered||y(null,$),k.rendered=!1,y.rendered=!1,$.auto2top&&c()}function y(e){E.navbar&&E.navbar===e||(E.navbar=e,y.rendered=!0,e&&q("nav",C(e)),l("nav"))}function k(e){var n=!1;e?e=C(e):$.sidebar?e=f($.sidebar,"