diff --git a/.travis.yml b/.travis.yml index 46029affecf..3280d947c9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,9 @@ +sudo: false + +language: ruby + rvm: - 1.9.3 - 2.0.0 + +cache: bundler diff --git a/CHANGELOG.md b/CHANGELOG.md index 8adca156616..59ee6a441e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## Version 1.2 + +*June 20, 2014* + +**Fixes:** + +- Remove crash on invalid languages +- Update Tocify to scroll to the highlighted header in the Table of Contents +- Fix variable leak and update search algorithms +- Update Python examples to be valid Python +- Update gems +- More misc. bugfixes of Javascript errors +- Add Dockerfile +- Remove unused gems +- Optimize images, fonts, and generated asset files +- Add chinese font support +- Remove RedCarpet header ID patch +- Update language tabs to not disturb existing query strings + ## Version 1.1 *July 27th, 2014* diff --git a/Gemfile b/Gemfile index df5651b2b81..3a2a2e01a82 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,12 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' # Middleman gem 'middleman', '~>3.3.10' gem 'middleman-gh-pages', '~> 0.0.3' gem 'middleman-syntax', '~> 2.0.0' -gem 'rouge', '~> 1.8.0' -gem 'redcarpet', '~> 3.2.2' +gem 'middleman-autoprefixer', '~> 2.4.4' +gem 'rouge', '~> 1.9.0' +gem 'redcarpet', '~> 3.3.1' gem 'rake', '~> 10.4.2' gem 'therubyracer', '~> 0.12.1', platforms: :ruby diff --git a/Gemfile.lock b/Gemfile.lock index e3931cd63af..f9978492816 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,15 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - activesupport (4.1.10) + activesupport (4.1.11) i18n (~> 0.6, >= 0.6.9) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.1) tzinfo (~> 1.1) + autoprefixer-rails (5.2.0.1) + execjs + json celluloid (0.16.0) timers (~> 4.0.0) chunky_png (1.3.4) @@ -36,25 +39,28 @@ GEM hooks (0.4.0) uber (~> 0.0.4) i18n (0.7.0) - json (1.8.2) + json (1.8.3) kramdown (1.7.0) libv8 (3.16.14.7) - listen (2.10.0) + listen (2.10.1) celluloid (~> 0.16.0) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) - middleman (3.3.11) + middleman (3.3.12) coffee-script (~> 2.2) compass (>= 1.0.0, < 2.0.0) compass-import-once (= 1.0.5) execjs (~> 2.0) haml (>= 4.0.5) kramdown (~> 1.2) - middleman-core (= 3.3.11) + middleman-core (= 3.3.12) middleman-sprockets (>= 3.1.2) sass (>= 3.4.0, < 4.0) uglifier (~> 2.5) - middleman-core (3.3.11) + middleman-autoprefixer (2.4.4) + autoprefixer-rails (~> 5.2.0) + middleman-core (>= 3.3.3) + middleman-core (3.3.12) activesupport (~> 4.1.0) bundler (~> 1.1) erubis @@ -76,25 +82,25 @@ GEM middleman-syntax (2.0.0) middleman-core (~> 3.2) rouge (~> 1.0) - minitest (5.6.1) - multi_json (1.11.0) + minitest (5.7.0) + multi_json (1.11.1) padrino-helpers (0.12.5) i18n (~> 0.6, >= 0.6.7) padrino-support (= 0.12.5) tilt (~> 1.4.1) padrino-support (0.12.5) activesupport (>= 3.1) - rack (1.6.0) + rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) rake (10.4.2) - rb-fsevent (0.9.4) + rb-fsevent (0.9.5) rb-inotify (0.9.5) ffi (>= 0.5.0) - redcarpet (3.2.3) + redcarpet (3.3.1) ref (1.0.5) - rouge (1.8.0) - sass (3.4.13) + rouge (1.9.0) + sass (3.4.14) sprockets (2.12.3) hike (~> 1.2) multi_json (~> 1.0) @@ -125,9 +131,10 @@ PLATFORMS DEPENDENCIES middleman (~> 3.3.10) + middleman-autoprefixer (~> 2.4.4) middleman-gh-pages (~> 0.0.3) middleman-syntax (~> 2.0.0) rake (~> 10.4.2) - redcarpet (~> 3.2.2) - rouge (~> 1.8.0) + redcarpet (~> 3.3.1) + rouge (~> 1.9.0) therubyracer (~> 0.12.1) diff --git a/README.md b/README.md index 76fefd5e3b7..d270a0c1ace 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Just [submit a issue](https://github.com/tripit/slate/issues) to the Slate Githu Contributors -------------------- -Slate was built by [Robert Lord](http://lord.io) while at [TripIt](http://tripit.com). +Slate was built by [Robert Lord](https://lord.io) while at [TripIt](http://tripit.com). Thanks to the following people who have submitted major pull requests: diff --git a/Rakefile b/Rakefile index d6af6474b1d..6a952e1e914 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,6 @@ require 'middleman-gh-pages' +require 'rake/clean' + +CLOBBER.include('build') task :default => [:build] diff --git a/config.rb b/config.rb index cd9a362f6ad..43bceaa5a43 100644 --- a/config.rb +++ b/config.rb @@ -18,6 +18,12 @@ # Activate the syntax highlighter activate :syntax +activate :autoprefixer do |config| + config.browsers = ['last 2 version', 'Firefox ESR'] + config.cascade = false + config.inline = true +end + # Github pages require relative links activate :relative_assets set :relative_links, true diff --git a/font-selection.json b/font-selection.json new file mode 100755 index 00000000000..5e78f5d8621 --- /dev/null +++ b/font-selection.json @@ -0,0 +1,148 @@ +{ + "IcoMoonType": "selection", + "icons": [ + { + "icon": { + "paths": [ + "M438.857 73.143q119.429 0 220.286 58.857t159.714 159.714 58.857 220.286-58.857 220.286-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857zM512 785.714v-108.571q0-8-5.143-13.429t-12.571-5.429h-109.714q-7.429 0-13.143 5.714t-5.714 13.143v108.571q0 7.429 5.714 13.143t13.143 5.714h109.714q7.429 0 12.571-5.429t5.143-13.429zM510.857 589.143l10.286-354.857q0-6.857-5.714-10.286-5.714-4.571-13.714-4.571h-125.714q-8 0-13.714 4.571-5.714 3.429-5.714 10.286l9.714 354.857q0 5.714 5.714 10t13.714 4.286h105.714q8 0 13.429-4.286t6-10z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "exclamation-circle" + ], + "defaultCode": 61546, + "grid": 14 + }, + "attrs": [], + "properties": { + "id": 100, + "order": 4, + "prevSize": 28, + "code": 58880, + "name": "exclamation-sign", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 0 + }, + { + "icon": { + "paths": [ + "M585.143 786.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-54.857v-292.571q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h54.857v182.857h-54.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h256q8 0 13.143-5.143t5.143-13.143zM512 274.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-109.714q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h109.714q8 0 13.143-5.143t5.143-13.143zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "info-circle" + ], + "defaultCode": 61530, + "grid": 14 + }, + "attrs": [], + "properties": { + "id": 85, + "order": 3, + "name": "info-sign", + "prevSize": 28, + "code": 58882 + }, + "setIdx": 0, + "iconIdx": 2 + }, + { + "icon": { + "paths": [ + "M733.714 419.429q0-16-10.286-26.286l-52-51.429q-10.857-10.857-25.714-10.857t-25.714 10.857l-233.143 232.571-129.143-129.143q-10.857-10.857-25.714-10.857t-25.714 10.857l-52 51.429q-10.286 10.286-10.286 26.286 0 15.429 10.286 25.714l206.857 206.857q10.857 10.857 25.714 10.857 15.429 0 26.286-10.857l310.286-310.286q10.286-10.286 10.286-25.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "check-circle" + ], + "defaultCode": 61528, + "grid": 14 + }, + "attrs": [], + "properties": { + "id": 83, + "order": 9, + "prevSize": 28, + "code": 58886, + "name": "ok-sign" + }, + "setIdx": 0, + "iconIdx": 6 + }, + { + "icon": { + "paths": [ + "M658.286 475.429q0-105.714-75.143-180.857t-180.857-75.143-180.857 75.143-75.143 180.857 75.143 180.857 180.857 75.143 180.857-75.143 75.143-180.857zM950.857 950.857q0 29.714-21.714 51.429t-51.429 21.714q-30.857 0-51.429-21.714l-196-195.429q-102.286 70.857-228 70.857-81.714 0-156.286-31.714t-128.571-85.714-85.714-128.571-31.714-156.286 31.714-156.286 85.714-128.571 128.571-85.714 156.286-31.714 156.286 31.714 128.571 85.714 85.714 128.571 31.714 156.286q0 125.714-70.857 228l196 196q21.143 21.143 21.143 51.429z" + ], + "width": 951, + "attrs": [], + "isMulticolor": false, + "tags": [ + "search" + ], + "defaultCode": 61442, + "grid": 14 + }, + "attrs": [], + "properties": { + "id": 2, + "order": 1, + "prevSize": 28, + "code": 58887, + "name": "icon-search" + }, + "setIdx": 0, + "iconIdx": 7 + } + ], + "height": 1024, + "metadata": { + "name": "slate", + "license": "SIL OFL 1.1" + }, + "preferences": { + "showGlyphs": true, + "showQuickUse": true, + "showQuickUse2": true, + "showSVGs": true, + "fontPref": { + "prefix": "icon-", + "metadata": { + "fontFamily": "slate", + "majorVersion": 1, + "minorVersion": 0, + "description": "Based on FontAwesome", + "license": "SIL OFL 1.1" + }, + "metrics": { + "emSize": 1024, + "baseline": 6.25, + "whitespace": 50 + }, + "resetPoint": 58880, + "showSelector": false, + "selector": "class", + "classSelector": ".icon", + "showMetrics": false, + "showMetadata": true, + "showVersion": true, + "ie7": false + }, + "imagePref": { + "prefix": "icon-", + "png": true, + "useClassSelector": true, + "color": 4473924, + "bgColor": 16777215 + }, + "historySize": 100, + "showCodes": true, + "gridSize": 16, + "showLiga": false + } +} diff --git a/source/fonts/icomoon.eot b/source/fonts/icomoon.eot deleted file mode 100755 index 212835a5243..00000000000 Binary files a/source/fonts/icomoon.eot and /dev/null differ diff --git a/source/fonts/icomoon.svg b/source/fonts/icomoon.svg deleted file mode 100755 index 24493587d38..00000000000 --- a/source/fonts/icomoon.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - \ No newline at end of file diff --git a/source/fonts/icomoon.ttf b/source/fonts/icomoon.ttf deleted file mode 100755 index 360b3d75162..00000000000 Binary files a/source/fonts/icomoon.ttf and /dev/null differ diff --git a/source/fonts/icomoon.woff b/source/fonts/icomoon.woff deleted file mode 100755 index 9a213b11266..00000000000 Binary files a/source/fonts/icomoon.woff and /dev/null differ diff --git a/source/fonts/slate.eot b/source/fonts/slate.eot new file mode 100755 index 00000000000..13c4839a197 Binary files /dev/null and b/source/fonts/slate.eot differ diff --git a/source/fonts/slate.svg b/source/fonts/slate.svg new file mode 100755 index 00000000000..5f34982306b --- /dev/null +++ b/source/fonts/slate.svg @@ -0,0 +1,14 @@ + + + diff --git a/source/fonts/slate.ttf b/source/fonts/slate.ttf new file mode 100755 index 00000000000..ace9a46a7e1 Binary files /dev/null and b/source/fonts/slate.ttf differ diff --git a/source/fonts/slate.woff b/source/fonts/slate.woff new file mode 100755 index 00000000000..1e72e0ee001 Binary files /dev/null and b/source/fonts/slate.woff differ diff --git a/source/fonts/slate.woff2 b/source/fonts/slate.woff2 new file mode 100755 index 00000000000..7c585a72737 Binary files /dev/null and b/source/fonts/slate.woff2 differ diff --git a/source/index.md b/source/index.md index ed5f6d63d0e..4c1fa8c9f7d 100644 --- a/source/index.md +++ b/source/index.md @@ -106,7 +106,7 @@ This endpoint retrieves all kittens. ### HTTP Request -`GET http://example.com/kittens` +`GET http://example.com/api/kittens` ### Query Parameters @@ -136,7 +136,7 @@ api.kittens.get(2) ``` ```shell -curl "http://example.com/api/kittens/3" +curl "http://example.com/api/kittens/2" -H "Authorization: meowmeowmeow" ``` @@ -164,5 +164,5 @@ This endpoint retrieves a specific kitten. Parameter | Description --------- | ----------- -ID | The ID of the cat to retrieve +ID | The ID of the kitten to retrieve diff --git a/source/javascripts/all.js b/source/javascripts/all.js index 534eae93090..ffaa9b01307 100644 --- a/source/javascripts/all.js +++ b/source/javascripts/all.js @@ -1,2 +1,4 @@ -//= require_tree ./lib -//= require_tree ./app +//= require ./lib/_energize +//= require ./app/_lang +//= require ./app/_search +//= require ./app/_toc diff --git a/source/javascripts/all_nosearch.js b/source/javascripts/all_nosearch.js index 4610cabe62d..818bc4e5095 100644 --- a/source/javascripts/all_nosearch.js +++ b/source/javascripts/all_nosearch.js @@ -1,4 +1,3 @@ -//= require_tree ./lib -//= require_tree ./app -//= stub ./app/search.js -//= stub ./lib/lunr.js +//= require ./lib/_energize +//= require ./app/_lang +//= require ./app/_toc diff --git a/source/javascripts/app/lang.js b/source/javascripts/app/_lang.js similarity index 50% rename from source/javascripts/app/lang.js rename to source/javascripts/app/_lang.js index 2683ef356db..1a124bb68ae 100644 --- a/source/javascripts/app/lang.js +++ b/source/javascripts/app/_lang.js @@ -40,6 +40,80 @@ under the License. } } + // parseURL and stringifyURL are from https://github.com/sindresorhus/query-string + // MIT licensed + // https://github.com/sindresorhus/query-string/blob/7bee64c16f2da1a326579e96977b9227bf6da9e6/license + function parseURL(str) { + if (typeof str !== 'string') { + return {}; + } + + str = str.trim().replace(/^(\?|#|&)/, ''); + + if (!str) { + return {}; + } + + return str.split('&').reduce(function (ret, param) { + var parts = param.replace(/\+/g, ' ').split('='); + var key = parts[0]; + var val = parts[1]; + + key = decodeURIComponent(key); + // missing `=` should be `null`: + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters + val = val === undefined ? null : decodeURIComponent(val); + + if (!ret.hasOwnProperty(key)) { + ret[key] = val; + } else if (Array.isArray(ret[key])) { + ret[key].push(val); + } else { + ret[key] = [ret[key], val]; + } + + return ret; + }, {}); + }; + + function stringifyURL(obj) { + return obj ? Object.keys(obj).sort().map(function (key) { + var val = obj[key]; + + if (Array.isArray(val)) { + return val.sort().map(function (val2) { + return encodeURIComponent(key) + '=' + encodeURIComponent(val2); + }).join('&'); + } + + return encodeURIComponent(key) + '=' + encodeURIComponent(val); + }).join('&') : ''; + }; + + // gets the language set in the query string + function getLanguageFromQueryString() { + if (location.search.length >= 1) { + var language = parseURL(location.search).language + if (language) { + return language; + } else if (jQuery.inArray(location.search.substr(1), languages) != -1) { + return location.search.substr(1); + } + } + + return false; + } + + // returns a new query string with the new language in it + function generateNewQueryString(language) { + var url = parseURL(location.search); + if (url.language) { + url.language = language; + return stringifyURL(url); + } + return language; + } + // if a button is clicked, add the state to the history function pushURL(language) { if (!history) { return; } @@ -47,23 +121,23 @@ under the License. if (hash) { hash = hash.replace(/^#+/, ''); } - history.pushState({}, '', '?' + language + '#' + hash); + history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash); // save language as next default localStorage.setItem("language", language); } function setupLanguages(l) { - var currentLanguage = l[0]; var defaultLanguage = localStorage.getItem("language"); languages = l; - if ((location.search.substr(1) !== "") && (jQuery.inArray(location.search.substr(1), languages)) != -1) { + var presetLanguage = getLanguageFromQueryString(); + if (presetLanguage) { // the language is in the URL, so use that language! - activateLanguage(location.search.substr(1)); + activateLanguage(presetLanguage); - localStorage.setItem("language", location.search.substr(1)); + localStorage.setItem("language", presetLanguage); } else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) { // the language was the last selected one saved in localstorage, so use that language! activateLanguage(defaultLanguage); @@ -81,8 +155,8 @@ under the License. activateLanguage(language); return false; }); - window.onpopstate = function(event) { - activateLanguage(window.location.search.substr(1)); + window.onpopstate = function() { + activateLanguage(getLanguageFromQueryString()); }; }); })(window); diff --git a/source/javascripts/app/search.js b/source/javascripts/app/_search.js similarity index 88% rename from source/javascripts/app/search.js rename to source/javascripts/app/_search.js index 3c22f714262..91f38a04edf 100644 --- a/source/javascripts/app/search.js +++ b/source/javascripts/app/_search.js @@ -1,8 +1,9 @@ -(function (global) { +//= require ../lib/_lunr +//= require ../lib/_jquery.highlight +(function () { 'use strict'; - var $global = $(global); - var content, darkBox, searchResults; + var content, searchResults; var highlightOpts = { element: 'span', className: 'search-highlight' }; var index = new lunr.Index(); @@ -29,7 +30,6 @@ function bind() { content = $('.content'); - darkBox = $('.dark-box'); searchResults = $('.search-results'); $('#input-search').on('keyup', search); @@ -56,7 +56,7 @@ highlight.call(this); } else { searchResults.html('
'); - $('.search-results li').text('No Results Found for "' + this.value + '"'); + $('.search-results li').text('No Results Found for "' + this.value + '"'); } } else { unhighlight(); @@ -71,5 +71,4 @@ function unhighlight() { content.unhighlight(highlightOpts); } - -})(window); +})(); diff --git a/source/javascripts/app/toc.js b/source/javascripts/app/_toc.js similarity index 94% rename from source/javascripts/app/toc.js rename to source/javascripts/app/_toc.js index c88b67f2b70..d84bf8e197a 100644 --- a/source/javascripts/app/toc.js +++ b/source/javascripts/app/_toc.js @@ -1,3 +1,5 @@ +//= require ../lib/_jquery_ui +//= require ../lib/_jquery.tocify (function (global) { 'use strict'; diff --git a/source/javascripts/lib/energize.js b/source/javascripts/lib/_energize.js similarity index 100% rename from source/javascripts/lib/energize.js rename to source/javascripts/lib/_energize.js diff --git a/source/javascripts/lib/jquery.highlight.js b/source/javascripts/lib/_jquery.highlight.js similarity index 100% rename from source/javascripts/lib/jquery.highlight.js rename to source/javascripts/lib/_jquery.highlight.js diff --git a/source/javascripts/lib/jquery.tocify.js b/source/javascripts/lib/_jquery.tocify.js similarity index 99% rename from source/javascripts/lib/jquery.tocify.js rename to source/javascripts/lib/_jquery.tocify.js index f791bf86246..91cf637913a 100644 --- a/source/javascripts/lib/jquery.tocify.js +++ b/source/javascripts/lib/_jquery.tocify.js @@ -1,4 +1,3 @@ -//= require ./jquery_ui /* jquery Tocify - v1.8.0 - 2013-09-16 * http://www.gregfranko.com/jquery.tocify.js/ * Copyright (c) 2013 Greg Franko; Licensed MIT @@ -1040,4 +1039,4 @@ }); -})); //end of plugin \ No newline at end of file +})); //end of plugin diff --git a/source/javascripts/lib/jquery_ui.js b/source/javascripts/lib/_jquery_ui.js similarity index 100% rename from source/javascripts/lib/jquery_ui.js rename to source/javascripts/lib/_jquery_ui.js diff --git a/source/javascripts/lib/lunr.js b/source/javascripts/lib/_lunr.js similarity index 100% rename from source/javascripts/lib/lunr.js rename to source/javascripts/lib/_lunr.js diff --git a/source/stylesheets/_icon-font.scss b/source/stylesheets/_icon-font.scss index 66504b55688..b5994839881 100644 --- a/source/stylesheets/_icon-font.scss +++ b/source/stylesheets/_icon-font.scss @@ -1,16 +1,17 @@ @font-face { - font-family: 'icomoon'; - src:font-url('icomoon.eot'); - src:font-url('icomoon.eot?#iefix') format('embedded-opentype'), - font-url('icomoon.ttf') format('truetype'), - font-url('icomoon.woff') format('woff'), - font-url('icomoon.svg#icomoon') format('svg'); + font-family: 'slate'; + src:font-url('slate.eot?-syv14m'); + src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'), + font-url('slate.woff2?-syv14m') format('woff2'), + font-url('slate.woff?-syv14m') format('woff'), + font-url('slate.ttf?-syv14m') format('truetype'), + font-url('slate.svg?-syv14m#slate') format('svg'); font-weight: normal; font-style: normal; } %icon { - font-family: 'icomoon'; + font-family: 'slate'; speak: none; font-style: normal; font-weight: normal; @@ -23,26 +24,10 @@ @extend %icon; content: "\e600"; } -%icon-question-sign { - @extend %icon; - content: "\e601"; -} %icon-info-sign { @extend %icon; content: "\e602"; } -%icon-remove-sign { - @extend %icon; - content: "\e603"; -} -%icon-plus-sign { - @extend %icon; - content: "\e604"; -} -%icon-minus-sign { - @extend %icon; - content: "\e605"; -} %icon-ok-sign { @extend %icon; content: "\e606"; diff --git a/source/stylesheets/_variables.scss b/source/stylesheets/_variables.scss index 4c9bae05ee1..5fe64b1f302 100644 --- a/source/stylesheets/_variables.scss +++ b/source/stylesheets/_variables.scss @@ -68,7 +68,7 @@ $phone-width: $tablet-width - $nav-width; // min width before reverting to mobil // FONTS //////////////////// %default-font { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif; font-size: 13px; } @@ -100,13 +100,10 @@ $search-box-border-color: #666; // These settings are probably best left alone. %break-words { - -ms-word-break: break-all; word-break: break-all; /* Non standard for webkit */ word-break: break-word; --webkit-hyphens: auto; - -moz-hyphens: auto; hyphens: auto; } diff --git a/source/stylesheets/screen.css.scss b/source/stylesheets/screen.css.scss index d64b3239574..e4b3ef82b22 100644 --- a/source/stylesheets/screen.css.scss +++ b/source/stylesheets/screen.css.scss @@ -49,25 +49,17 @@ html, body { } @mixin embossed-bg { - @include background( - linear-gradient(top, - rgba(#000, 0.2), - rgba(#000, 0) 8px), - linear-gradient(bottom, - rgba(#000, 0.2), - rgba(#000, 0) 8px), - linear-gradient(top, - rgba($nav-embossed-border-top, 1), - rgba($nav-embossed-border-top, 0) 1.5px), - linear-gradient(bottom, - rgba($nav-embossed-border-bottom, 1), - rgba($nav-embossed-border-bottom, 0) 1.5px), - $nav-subitem-bg - ); + background: + linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px), + linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px), + linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px), + linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px), + $nav-subitem-bg; } .tocify-wrapper { - @include transition(left ease-in-out 0.3s); + transition: left 0.3s ease-in-out; + overflow-y: auto; overflow-x: hidden; position: fixed; @@ -102,7 +94,7 @@ html, body { border-width: 0 0 1px 0; border-color: $search-box-border-color; padding: 6px 0 6px 20px; - @include box-sizing(border-box); + box-sizing: border-box; margin: $nav-v-padding $nav-padding; width: $nav-width - 30; outline: none; @@ -125,13 +117,13 @@ html, body { .search-results { margin-top: 0; - @include box-sizing(border-box); + box-sizing: border-box; height: 0; overflow-y: auto; overflow-x: hidden; - @include transition-property(height margin); - @include transition-duration(180ms); - @include transition-timing-function(ease-in-out); + transition-property: height, margin; + transition-duration: 180ms; + transition-timing-function: ease-in-out; &.visible { height: 30%; margin-bottom: 1em; @@ -175,14 +167,14 @@ html, body { li { color: $nav-text; - @include transition-property('background'); - @include transition-timing-function('linear'); - @include transition-duration(230ms); + transition-property: background; + transition-timing-function: linear; + transition-duration: 230ms; } // This is the currently selected ToC entry .tocify-focus { - @include box-shadow(0px 1px 0px $nav-active-shadow); + box-shadow: 0px 1px 0px $nav-active-shadow; background-color: $nav-active-bg; color: $nav-active-text; } @@ -235,8 +227,8 @@ html, body { $side-pad: $main-padding / 2 - 8px; padding: $side-pad $side-pad $side-pad; background-color: rgba($main-bg, 0.7); - @include transform-origin(0, 0); - @include transform(rotate(-90deg) translate(-100%, 0)); + transform-origin: 0 0; + transform: rotate(-90deg) translate(-100%, 0); border-radius: 0 0 0 5px; } padding: 0 1.5em 5em 0; // increase touch size area @@ -255,7 +247,7 @@ html, body { vertical-align: bottom; } - @include transition(left ease-in-out 0.3s); + transition: left 0.3s ease-in-out; &:hover { opacity: 1; } &.open {left: $nav-width} @@ -346,7 +338,7 @@ html, body { &>h1, &>h2, &>h3, &>h4, &>h5, &>h6, &>p, &>table, &>ul, &>ol, &>aside, &>dl { margin-right: $examples-width; padding: 0 $main-padding; - @include box-sizing(border-box); + box-sizing: border-box; display: block; @include text-shadow($main-embossed-text-shadow); @@ -371,9 +363,7 @@ html, body { margin-bottom: $h1-margin-bottom; margin-top: 2em; border-top: 1px solid #ddd; - @include background-image( - linear-gradient(top, #fff, #f9f9f9) - ); + background-image: linear-gradient(to bottom, #fff, #f9f9f9); } h1:first-child, div:first-child + h1 { @@ -389,9 +379,7 @@ html, body { border-top: 1px solid #ccc; padding-top: 1.2em; padding-bottom: 1.2em; - @include background-image( - linear-gradient(top, rgba(#fff,0.4), rgba(#fff, 0)) - ); + background-image: linear-gradient(to bottom, rgba(#fff, 0.4), rgba(#fff, 0)); } // h2s right after h1s should bump right up @@ -403,10 +391,9 @@ html, body { h3, h4, h5, h6 { @extend %header-font; - font-size: 12px; + font-size: 15px; margin-top: 2.5em; margin-bottom: 0.8em; - text-transform: uppercase; } h4, h5, h6 { @@ -525,7 +512,7 @@ html, body { border-radius: 4px; border: 1px solid #F7E633; @include text-shadow(1px 1px 0 #666); - @include background(linear-gradient(bottom right, #F7E633 0%, #F1D32F 100%)); + background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%); } } @@ -546,7 +533,7 @@ html, body { float:right; clear:right; - @include box-sizing(border-box); + box-sizing: border-box; @include text-shadow(0px 1px 2px rgba(0,0,0,0.4)); @extend %right-col;