From 1e3399834401934c6288fabe97b69e8cc69ada28 Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Mon, 30 Oct 2017 06:21:44 +0000 Subject: [PATCH] Update from ruby Slate v2.1.0 --- buildstyle.js | 4 +- pub/css/screen.css | 4 +- source/stylesheets/_rtl.scss | 140 +++++++++++++++++++++++++++++ source/stylesheets/screen.css.scss | 6 +- 4 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 source/stylesheets/_rtl.scss diff --git a/buildstyle.js b/buildstyle.js index b0e513fa..c530a720 100644 --- a/buildstyle.js +++ b/buildstyle.js @@ -16,7 +16,9 @@ function sassRender(infile,outfile) { }, function(err, result) { if (err) console.error(err) else { - fs.writeFile(outfile,result.css.toString(),'utf8'); + fs.writeFile(outfile,result.css.toString(),'utf8',function(err){ + if (err) console.warn(err.message); + }); } }); } diff --git a/pub/css/screen.css b/pub/css/screen.css index a0d40f76..840f583d 100644 --- a/pub/css/screen.css +++ b/pub/css/screen.css @@ -686,6 +686,8 @@ html, body { text-align: left; vertical-align: top; line-height: 1.6; } + .content table th code, .content table td code { + white-space: nowrap; } .content table th { padding: 5px 10px; border-bottom: 1px solid #ccc; @@ -731,7 +733,7 @@ html, body { font-size: 14px; } .content .search-highlight { padding: 2px; - margin: -2px; + margin: -3px; border-radius: 4px; border: 1px solid #F7E633; background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%); } diff --git a/source/stylesheets/_rtl.scss b/source/stylesheets/_rtl.scss new file mode 100644 index 00000000..720719a0 --- /dev/null +++ b/source/stylesheets/_rtl.scss @@ -0,0 +1,140 @@ +//////////////////////////////////////////////////////////////////////////////// +// RTL Styles Variables +//////////////////////////////////////////////////////////////////////////////// + +$default: auto; + +//////////////////////////////////////////////////////////////////////////////// +// TABLE OF CONTENTS +//////////////////////////////////////////////////////////////////////////////// + +#toc>ul>li>a>span { + float: left; +} + +.toc-wrapper { + transition: right 0.3s ease-in-out !important; + left: $default !important; + #{right}: 0; +} + +.toc-h2 { + padding-#{right}: $nav-padding + $nav-indent; +} + +#nav-button { + #{right}: 0; + transition: right 0.3s ease-in-out; + &.open { + right: $nav-width + } +} + +//////////////////////////////////////////////////////////////////////////////// +// PAGE LAYOUT AND CODE SAMPLE BACKGROUND +//////////////////////////////////////////////////////////////////////////////// +.page-wrapper { + margin-#{left}: $default !important; + margin-#{right}: $nav-width; + .dark-box { + #{right}: $default; + #{left}: 0; + } +} + +.lang-selector { + width: $default !important; + a { + float: right; + } +} + +//////////////////////////////////////////////////////////////////////////////// +// CODE SAMPLE STYLES +//////////////////////////////////////////////////////////////////////////////// +.content { + &>h1, + &>h2, + &>h3, + &>h4, + &>h5, + &>h6, + &>p, + &>table, + &>ul, + &>ol, + &>aside, + &>dl { + margin-#{left}: $examples-width; + margin-#{right}: $default !important; + } + &>ul, + &>ol { + padding-#{right}: $main-padding + 15px; + } + table { + th, + td { + text-align: right; + } + } + dd { + margin-#{right}: 15px; + } + aside { + aside:before { + padding-#{left}: 0.5em; + } + .search-highlight { + background: linear-gradient(to top right, #F7E633 0%, #F1D32F 100%); + } + } + pre, + blockquote { + float: left !important; + clear: left !important; + } +} + +//////////////////////////////////////////////////////////////////////////////// +// TYPOGRAPHY +//////////////////////////////////////////////////////////////////////////////// +h1, +h2, +h3, +h4, +h5, +h6, +p, +aside { + text-align: right; + direction: rtl; +} + +.toc-wrapper { + text-align: right; + direction: rtl; + font-weight: 100 !important; +} + + +//////////////////////////////////////////////////////////////////////////////// +// RESPONSIVE DESIGN +//////////////////////////////////////////////////////////////////////////////// +@media (max-width: $tablet-width) { + .toc-wrapper { + #{right}: -$nav-width; + &.open { + #{right}: 0; + } + } + .page-wrapper { + margin-#{right}: 0; + } +} + +@media (max-width: $phone-width) { + %left-col { + margin-#{left}: 0; + } +} diff --git a/source/stylesheets/screen.css.scss b/source/stylesheets/screen.css.scss index 7abf60e0..84848db7 100644 --- a/source/stylesheets/screen.css.scss +++ b/source/stylesheets/screen.css.scss @@ -2,6 +2,7 @@ @import 'normalize'; @import 'variables'; @import 'icon-font'; +// @import 'rtl'; // uncomment to switch to RTL format /* Copyright 2008-2013 Concur Technologies, Inc. @@ -405,6 +406,9 @@ html, body { text-align: left; vertical-align: top; line-height: 1.6; + code { + white-space: nowrap; + } } th { @@ -497,7 +501,7 @@ html, body { .search-highlight { padding: 2px; - margin: -2px; + margin: -3px; border-radius: 4px; border: 1px solid #F7E633; background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);