diff --git a/.travis.yml b/.travis.yml index e3fceec9..d5e5a6aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: ruby + +cache: bundler + before_script: - gem update --system - gem install bundler diff --git a/Gemfile b/Gemfile index cf709487..5513b152 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ group :app do gem 'rack' gem 'sinatra' gem 'sinatra-contrib' + gem 'rack-ssl-enforcer' gem 'thin' gem 'sprockets' gem 'sprockets-helpers' diff --git a/Gemfile.lock b/Gemfile.lock index 3fdb414f..c3d1907f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,13 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.2.0) + activesupport (5.2.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - backports (3.11.3) - better_errors (2.4.0) + backports (3.11.4) + better_errors (2.5.0) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) @@ -28,42 +28,43 @@ GEM exifr (1.3.4) ffi (1.9.25) fspath (3.1.0) - highline (1.7.10) + highline (2.0.0) html-pipeline (2.8.4) activesupport (>= 2) nokogiri (>= 1.4) - i18n (1.0.1) + i18n (1.1.1) concurrent-ruby (~> 1.0) - image_optim (0.26.1) + image_optim (0.26.3) exifr (~> 1.2, >= 1.2.2) fspath (~> 3.0) - image_size (~> 1.5) + image_size (>= 1.5, < 3) in_threads (~> 1.3) progress (~> 3.0, >= 3.0.1) image_optim_pack (0.5.1) fspath (>= 2.1, < 4) image_optim (~> 0.19) - image_size (1.5.0) + image_size (2.0.0) in_threads (1.5.0) method_source (0.9.0) mini_portile2 (2.3.0) minitest (5.11.3) multi_json (1.13.1) - mustermann (1.0.2) - newrelic_rpm (5.2.0.345) - nokogiri (1.8.4) + mustermann (1.0.3) + newrelic_rpm (5.4.0.347) + nokogiri (1.8.5) mini_portile2 (~> 2.3.0) options (2.3.2) - progress (3.4.0) - progress_bar (1.2.0) - highline (~> 1.6) + progress (3.5.0) + progress_bar (1.3.0) + highline (>= 1.6, < 3) options (~> 2.3.0) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) rack (2.0.5) - rack-protection (2.0.3) + rack-protection (2.0.4) rack + rack-ssl-enforcer (0.2.9) rack-test (1.1.0) rack (>= 1.0, < 3) rake (12.3.1) @@ -71,23 +72,23 @@ GEM rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) rr (1.2.1) - sass (3.5.7) + sass (3.6.0) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sinatra (2.0.3) + sinatra (2.0.4) mustermann (~> 1.0) rack (~> 2.0) - rack-protection (= 2.0.3) + rack-protection (= 2.0.4) tilt (~> 2.0) - sinatra-contrib (2.0.3) + sinatra-contrib (2.0.4) activesupport (>= 4.0.0) backports (>= 2.8.2) multi_json mustermann (~> 1.0) - rack-protection (= 2.0.3) - sinatra (= 2.0.3) + rack-protection (= 2.0.4) + sinatra (= 2.0.4) tilt (>= 1.3, < 3) sprockets (3.7.2) concurrent-ruby (~> 1.0) @@ -96,9 +97,11 @@ GEM sprockets (>= 2.2) sprockets-sass (2.0.0.beta2) sprockets (>= 2.0, < 4.0) - strings (0.1.1) - unicode-display_width (~> 1.3.0) + strings (0.1.4) + strings-ansi (~> 0.1.0) + unicode-display_width (~> 1.4.0) unicode_utils (~> 1.4.0) + strings-ansi (0.1.0) thin (1.7.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) @@ -116,9 +119,9 @@ GEM ethon (>= 0.9.0) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.17) + uglifier (4.1.19) execjs (>= 0.3.0, < 3) - unicode-display_width (1.3.3) + unicode-display_width (1.4.0) unicode_utils (1.4.0) unix_utils (0.0.15) yajl-ruby (1.4.1) @@ -142,6 +145,7 @@ DEPENDENCIES progress_bar pry (~> 0.11.0) rack + rack-ssl-enforcer rack-test rake rr @@ -163,4 +167,4 @@ RUBY VERSION ruby 2.5.1p57 BUNDLED WITH - 1.16.4 + 1.16.6 diff --git a/README.md b/README.md index 119c6fe1..eec50904 100644 --- a/README.md +++ b/README.md @@ -64,14 +64,10 @@ Another driving factor is performance and the fact that everything happens in th DevDocs being a developer tool, the browser requirements are high: -1. On the desktop: - * Recent version of Chrome, Firefox, or Opera - * Safari 8+ - * IE / Edge 10+ -2. On mobile: - * iOS 8+ - * Android 4.1+ - * Windows Phone 8+ +* Recent versions of Firefox, Chrome, or Opera +* Safari 9.1+ +* Edge 16+ +* iOS 10+ This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun! diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index 979ea353..3a8e2b62 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -245,7 +245,7 @@ matchMedia: !!window.matchMedia insertAdjacentHTML: !!document.body.insertAdjacentHTML defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false - cssGradients: supportsCssGradients() + cssVariables: CSS.supports and CSS.supports('(--t: 0)') for key, value of features when not value Raven.captureMessage "unsupported/#{key}", level: 'info' @@ -268,9 +268,4 @@ isInvalidLocation: -> @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0 -supportsCssGradients = -> - el = document.createElement('div') - el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);" - el.style.backgroundImage.indexOf('gradient') >= 0 - $.extend app, Events diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index 8df7422e..5d3f6c88 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -190,7 +190,7 @@ isSameOrigin = (url) -> updateCanonicalLink = -> @canonicalLink ||= document.head.querySelector('link[rel="canonical"]') - @canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}") + @canonicalLink.setAttribute('href', "https://#{location.host}#{location.pathname}") trackers = [] diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index aff770f4..32da738e 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2018-09-23", + "New documentations: Puppeteer and Handlebars.js" + ], [ "2018-08-12", "New documentations: Dart and Qt" ], [ diff --git a/assets/javascripts/templates/error_tmpl.coffee b/assets/javascripts/templates/error_tmpl.coffee index 9c19c0a6..37e2b5e4 100644 --- a/assets/javascripts/templates/error_tmpl.coffee +++ b/assets/javascripts/templates/error_tmpl.coffee @@ -56,13 +56,10 @@ app.templates.unsupportedBrowser = """

Your browser is unsupported, sorry.

DevDocs is an API documentation browser which supports the following browsers:

If you're unable to upgrade, I apologize. diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 629682fb..26ca8e7e 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -310,6 +310,11 @@ credits = [ 'GruntJS Team', 'MIT', 'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10' + ], [ + 'Handlebars', + '2011-2017 Yehuda Katz', + 'MIT', + 'https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE' ], [ 'Haskell', 'The University of Glasgow', @@ -560,6 +565,11 @@ credits = [ '1996-2018 The PostgreSQL Global Development Group
© 1994 The Regents of the University of California', 'PostgreSQL', 'https://www.postgresql.org/about/licence/' + ], [ + 'Puppeteer', + '2017 Google Inc', + 'Apache', + 'https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE' ], [ 'Pygame', 'Pygame Developpers', diff --git a/assets/javascripts/templates/pages/root_tmpl.coffee.erb b/assets/javascripts/templates/pages/root_tmpl.coffee.erb index ef5ee8e6..b5369403 100644 --- a/assets/javascripts/templates/pages/root_tmpl.coffee.erb +++ b/assets/javascripts/templates/pages/root_tmpl.coffee.erb @@ -72,14 +72,3 @@ app.templates.androidWarning = """

To install DevDocs on your phone, visit devdocs.io in Chrome and select "Add to home screen" in the menu. """ - -app.templates.httpWarning = """ -

-

Hi there!

-

DevDocs is migrating to HTTPS. -

Please update your bookmarks to point to https://devdocs.io. -

When using the HTTPS version, your preferences will carry over automatically, but your offline data will be reset. Simply re-download documentation in the Offline area, and you'll be all set to use DevDocs securely offline. -

Sorry for the inconvenience. This migration is needed because browsers are removing support for certain DOM APIs that power DevDocs's offline mode over non-secure origins. -

Thanks for using DevDocs, and happy coding! -

-""" diff --git a/assets/javascripts/views/content/root_page.coffee b/assets/javascripts/views/content/root_page.coffee index e442887a..b48a1df3 100644 --- a/assets/javascripts/views/content/root_page.coffee +++ b/assets/javascripts/views/content/root_page.coffee @@ -19,10 +19,6 @@ class app.views.RootPage extends app.View else 'intro' - # temporary - if location.host is 'devdocs.io' and location.protocol is 'http:' - tmpl = 'httpWarning' - @append @tmpl(tmpl) return diff --git a/assets/javascripts/views/content/settings_page.coffee b/assets/javascripts/views/content/settings_page.coffee index d72e3eb3..e39b17df 100644 --- a/assets/javascripts/views/content/settings_page.coffee +++ b/assets/javascripts/views/content/settings_page.coffee @@ -24,10 +24,9 @@ class app.views.SettingsPage extends app.View 'Preferences' toggleDark: (enable) -> - css = $('link[rel="stylesheet"][data-alt]') - alt = css.getAttribute('data-alt') - css.setAttribute('data-alt', css.getAttribute('href')) - css.setAttribute('href', alt) + html = document.documentElement + html.classList.toggle('_theme-default') + html.classList.toggle('_theme-dark') app.settings.set('dark', !!enable) app.appCache?.updateInBackground() return diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss deleted file mode 100644 index a1676513..00000000 --- a/assets/stylesheets/application-dark.css.scss +++ /dev/null @@ -1,107 +0,0 @@ -//= depend_on sprites/docs.png -//= depend_on sprites/docs@2x.png -//= depend_on sprites/docs.json - -/*! - * Copyright 2013-2018 Thibaut Courouble and other contributors - * - * This source code is licensed under the terms of the Mozilla - * Public License, v. 2.0, a copy of which may be obtained at: - * http://mozilla.org/MPL/2.0/ - */ - -@import 'global/variables-dark', - 'global/mixins', - 'global/icons', - 'global/classes', - 'global/base'; - -@import 'components/app', - 'components/header', - 'components/notif', - 'components/sidebar', - 'components/settings', - 'components/content', - 'components/page', - 'components/fail', - 'components/path', - 'components/notice', - 'components/prism', - 'components/mobile'; - -@import 'pages/simple', - 'pages/angular', - 'pages/angularjs', - 'pages/apache', - 'pages/async', - 'pages/bash', - 'pages/bootstrap', - 'pages/c', - 'pages/cakephp', - 'pages/clojure', - 'pages/codeception', - 'pages/coffeescript', - 'pages/cordova', - 'pages/crystal', - 'pages/d', - 'pages/d3', - 'pages/dart', - 'pages/dojo', - 'pages/drupal', - 'pages/elixir', - 'pages/ember', - 'pages/erlang', - 'pages/express', - 'pages/git', - 'pages/github', - 'pages/go', - 'pages/graphite', - 'pages/haskell', - 'pages/jekyll', - 'pages/jquery', - 'pages/julia', - 'pages/knockout', - 'pages/kotlin', - 'pages/laravel', - 'pages/liquid', - 'pages/love', - 'pages/lua', - 'pages/mdn', - 'pages/meteor', - 'pages/modernizr', - 'pages/moment', - 'pages/nginx', - 'pages/node', - 'pages/npm', - 'pages/openjdk', - 'pages/perl', - 'pages/phalcon', - 'pages/phaser', - 'pages/php', - 'pages/phpunit', - 'pages/postgres', - 'pages/pug', - 'pages/python', - 'pages/qt', - 'pages/ramda', - 'pages/rdoc', - 'pages/react_native', - 'pages/redis', - 'pages/rethinkdb', - 'pages/rfc', - 'pages/rubydoc', - 'pages/rust', - 'pages/sinon', - 'pages/socketio', - 'pages/sphinx', - 'pages/sphinx_simple', - 'pages/sqlite', - 'pages/support_tables', - 'pages/tcl_tk', - 'pages/tensorflow', - 'pages/terraform', - 'pages/underscore', - 'pages/vue', - 'pages/webpack', - 'pages/yard', - 'pages/yii'; diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 9720f0c4..7c43dde3 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -10,7 +10,9 @@ * http://mozilla.org/MPL/2.0/ */ -@import 'global/variables', +@import 'global/variables-light', + 'global/variables-dark', + 'global/variables', 'global/mixins', 'global/icons', 'global/classes', diff --git a/assets/stylesheets/components/_app.scss b/assets/stylesheets/components/_app.scss index ee76fe2f..96e09938 100644 --- a/assets/stylesheets/components/_app.scss +++ b/assets/stylesheets/components/_app.scss @@ -1,6 +1,6 @@ -html._booting { background: $contentBackground; } +html._booting { background: var(--contentBackground); } body._max-width { background: none; } -html._booting body._max-width { background: $documentBackground; } +html._booting body._max-width { background: var(--documentBackground); } ._app { position: relative; @@ -15,8 +15,8 @@ html._booting body._max-width { background: $documentBackground; } ._max-width & { margin: 0 auto; - max-width: $maxWidth; - background: $contentBackground; - box-shadow: 1px 0 $headerBorder, -1px 0 $headerBorder; + max-width: var(--maxWidth); + background: var(--contentBackground); + box-shadow: 1px 0 var(--headerBorder), -1px 0 var(--headerBorder); } } diff --git a/assets/stylesheets/components/_content.scss b/assets/stylesheets/components/_content.scss index 18f2e51d..c2387836 100644 --- a/assets/stylesheets/components/_content.scss +++ b/assets/stylesheets/components/_content.scss @@ -4,13 +4,13 @@ ._container { position: relative; - z-index: $contentZ; + z-index: var(--contentZ); height: 100%; - margin-left: $sidebarWidth; + margin-left: var(--sidebarWidth); pointer-events: none; @extend %border-box; - @media #{$mediumScreen} { margin-left: $sidebarMediumWidth; } + @include mobile { margin-left: var(--sidebarMediumWidth); } ._sidebar-hidden & { margin-left: 0; } body:not(._native-scrollbars) & { -webkit-margin-end: -1px; } @@ -30,7 +30,7 @@ ._sidebar-hidden &:before { content: ''; display: block; - margin-top: $headerHeight; + margin-top: var(--headerHeight); } ._overlay-scrollbars & { padding-left: .625rem; } @@ -54,7 +54,7 @@ font-size: 4rem; font-weight: 300; letter-spacing: -.125rem; - color: $loadingText; + color: var(--loadingText); text-align: center; cursor: default; } @@ -68,7 +68,7 @@ // ._splash-title { - color: $splashText; + color: var(--splashText); @extend %loading, %user-select-none; } @@ -88,7 +88,7 @@ min-height: calc(100vh - 2.375rem); ._sidebar-hidden & { - min-height: calc(100vh - 2.375rem - #{$headerHeight}); + min-height: calc(100vh - 2.375rem - var(--headerHeight)); } } @@ -140,12 +140,12 @@ ._error-text { margin: 0 0 1rem; - color: $textColorLight; + color: var(--textColorLight); } ._error-links { font-size: 1rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } ._error-link { padding: 0 .5rem; } @@ -167,7 +167,7 @@ height: 1px; margin-top: .25rem; margin-left: 1rem; - background: $boxBorderLight; + background: var(--boxBorderLight); } } @@ -197,7 +197,7 @@ ._toc-title { margin: 0 0 .5rem; font-size: inherit; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } ._toc-list { @@ -252,7 +252,7 @@ ._docs-size { text-align: right; - > small { color: $textColorLight; } + > small { color: var(--textColorLight); } } ._docs-tools { @@ -285,7 +285,7 @@ padding: 0 .75rem; } ._btn-link:not(._show) { display: none; } - ._btn-link._show ~ ._btn-link._show { border-left: 1px solid $boxBorder; } + ._btn-link._show ~ ._btn-link._show { border-left: 1px solid var(--boxBorder); } } // @@ -297,7 +297,7 @@ position: relative; padding-left: 10em; font-size: .8125rem; - color: $textColorLight; + color: var(--textColorLight); + ._news-row { margin-top: 1em; } } @@ -305,7 +305,7 @@ ._news-title { display: block; font-size: .875rem; - color: $textColor; + color: var(--textColor); } ._news-date { @@ -372,12 +372,12 @@ // Utilities // -._bold { font-weight: $boldFontWeight; } +._bold { font-weight: var(--boldFontWeight); } ._note { @extend %note; } ._note-green { @extend %note-green; } ._label { @extend %label; } ._code { @extend %code; } -._highlight { background: $highlightBackground !important; } +._highlight { background: var(--highlightBackground) !important; } ._table { width: 100%; } ._mobile ._table { overflow-x: auto; } @@ -396,12 +396,9 @@ pre:hover > & { display: block; } &:hover { opacity: 1; } - > svg { @extend %svg-icon; } - - @if $style == 'dark' { - > svg { fill: white; } - } @else { - > svg { fill: black; } + > svg { + @extend %svg-icon; + fill: var(--absolute); } &._pre-clip-success > svg, @@ -419,15 +416,13 @@ line-height: normal; white-space: nowrap; padding: .375rem .675rem; - background-image: linear-gradient(lighten($boxBackground, 4%), darken($boxBackground, 2%)); - border: 1px solid $boxBorder; + background-color: var(--boxBackground); + border: 1px solid var(--boxBorder); border-radius: 3px; - box-shadow: 0 1px rgba($boxBorder, .08); cursor: pointer; &:active { - background-color: $boxBackground; - box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px $boxBorder; + box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px var(--boxBorder); } } @@ -447,18 +442,18 @@ ._btn-link { line-height: inherit; - color: $linkColor; - text-decoration: $linkTextDecoration; + color: var(--linkColor); + text-decoration: var(--linkTextDecoration); &:hover { - color: $linkColorHover; + color: var(--linkColorHover); text-decoration: underline; } } ._reset-btn, ._reset-btn:hover { - color: $textColorRed; + color: var(--textColorRed); } ._github-btn { diff --git a/assets/stylesheets/components/_fail.scss b/assets/stylesheets/components/_fail.scss index c1cf4653..535100ac 100644 --- a/assets/stylesheets/components/_fail.scss +++ b/assets/stylesheets/components/_fail.scss @@ -1,4 +1,4 @@ -._fail { +._fail { // Don't use CSS variables, in case the browser doesn't support them. display: block; position: relative; top: 1.5rem; @@ -23,7 +23,7 @@ ._fail-title { margin: 0 0 1rem; font-size: 1rem; - font-weight: $boldFontWeight; + font-weight: bold; } ._fail-text, ._fail-list { diff --git a/assets/stylesheets/components/_header.scss b/assets/stylesheets/components/_header.scss index 37f9268d..5bae8901 100644 --- a/assets/stylesheets/components/_header.scss +++ b/assets/stylesheets/components/_header.scss @@ -4,20 +4,20 @@ ._header { position: absolute; - z-index: $headerZ; + z-index: var(--headerZ); top: 0; left: 0; display: -ms-flexbox; display: flex; - width: $sidebarWidth; - height: $headerHeight; - background: $headerBackground; - border-bottom: 1px solid $headerBorder; - border-right: 1px solid $headerBorder; + width: var(--sidebarWidth); + height: var(--headerHeight); + background: var(--headerBackground); + border-bottom: 1px solid var(--headerBorder); + border-right: 1px solid var(--headerBorder); @extend %border-box; @extend %user-select-none; - @media #{$mediumScreen} { width: $sidebarMediumWidth; } + @include mobile { width: var(--sidebarMediumWidth); } } ._header-left { @@ -35,7 +35,7 @@ flex: 0 0 auto; width: 2.25rem; height: 100%; - color: $textColorLight; + color: var(--textColorLight); text-align: center; &[hidden] { display: none; } @@ -67,8 +67,8 @@ word-wrap: normal; overflow-wrap: normal; font-size: .875rem; - background: $contentBackground; - border: 1px solid $headerBorder; + background: var(--contentBackground); + border: 1px solid var(--headerBorder); border-radius: 3px; box-shadow: -1px 1px 1px rgba(black, .05); transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms; @@ -98,10 +98,10 @@ margin: 0; line-height: 1.5rem; font-size: 1rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); letter-spacing: -.5px; - background: $sidebarBackground; - border-bottom: 1px solid $sidebarBorder; + background: var(--sidebarBackground); + border-bottom: 1px solid var(--sidebarBorder); border-radius: 2px 2px 0 0; } @@ -109,7 +109,7 @@ ._menu-title-link:hover { display: block; padding: .5rem 1rem; - color: $focusText; + color: var(--focusText); text-decoration: none; } @@ -121,9 +121,9 @@ text-decoration: none; &:hover { - color: $focusText; + color: var(--focusText); text-decoration: none; - background: $sidebarBackground; + background: var(--sidebarBackground); } &:last-child { border-radius: 0 0 2px 2px; } @@ -151,11 +151,7 @@ opacity: .42; @extend %svg-icon; - @if $style == 'dark' { - fill: white; - } @else { - fill: black; - } + fill: var(--absolute); } } @@ -166,21 +162,19 @@ height: 100%; padding: 0 .75rem 1px 1.75rem; font-size: .875rem; - background: $contentBackground; + background: var(--contentBackground); border: 1px solid; - border-color: darken($headerBorder, 2%); + border-color: var(--searchBorder); border-radius: 3px; &:focus { outline: 0; - @if $inputFocusBorder { - border-color: $inputFocusBorder; - box-shadow: 0 0 1px $inputFocusBorder; - } + border-color: var(--inputFocusBorder); + box-shadow: 0 0 1px var(--inputFocusBorder); } &[disabled] { - background: $sidebarBackground; + background: var(--sidebarBackground); cursor: not-allowed; } } @@ -202,13 +196,9 @@ top: .5rem; left: .375rem; @extend %svg-icon; + fill: var(--absolute); } - @if $style == 'dark' { - > svg { fill: white; } - } @else { - > svg { fill: black; } - } ._search-active > & { display: block; } } @@ -222,8 +212,8 @@ line-height: 1.25rem; max-width: 50%; font-size: .8125rem; - color: $textColorLight; - background: darken($headerBackground, 5%); + color: var(--textColorLight); + background: var(--searchTagBackground); border-radius: 2px; @extend %truncate-text; } diff --git a/assets/stylesheets/components/_mobile.scss b/assets/stylesheets/components/_mobile.scss index 34ad7dbe..bdfe01fd 100644 --- a/assets/stylesheets/components/_mobile.scss +++ b/assets/stylesheets/components/_mobile.scss @@ -4,7 +4,7 @@ ._mobile { font-size: 100%; - background: $contentBackground; + background: var(--contentBackground); ._hide-on-mobile { display: none; } @@ -18,7 +18,7 @@ ._container { margin: 0; - padding-top: $headerHeight; + padding-top: var(--headerHeight); } ._content { diff --git a/assets/stylesheets/components/_notice.scss b/assets/stylesheets/components/_notice.scss index 0dba80ae..1e8cd381 100644 --- a/assets/stylesheets/components/_notice.scss +++ b/assets/stylesheets/components/_notice.scss @@ -1,15 +1,15 @@ ._notice { position: absolute; - z-index: $noticeZ; + z-index: var(--noticeZ); bottom: 0; - left: $sidebarWidth; + left: var(--sidebarWidth); right: 0; height: 2.5rem; padding: 0 1.25rem; - background: $noticeBackground; - box-shadow: inset 0 1px $noticeBorder; + background: var(--noticeBackground); + box-shadow: inset 0 1px var(--noticeBorder); - @media #{$mediumScreen} { left: $sidebarMediumWidth; } + @include mobile { left: var(--sidebarMediumWidth); } ._sidebar-hidden & { left: 0; } diff --git a/assets/stylesheets/components/_notif.scss b/assets/stylesheets/components/_notif.scss index a47d396d..dd23c43a 100644 --- a/assets/stylesheets/components/_notif.scss +++ b/assets/stylesheets/components/_notif.scss @@ -7,9 +7,9 @@ max-width: 90%; padding: .625rem 1rem; font-size: .75rem; - color: $notifColor; - background: $notifBackground; - border: $notifBorder; + color: var(--notifColor); + background: var(--notifBackground); + border: var(--notifBorder); border-radius: .25rem; transition: opacity .2s; opacity: 0; @@ -30,7 +30,7 @@ ._notif-info { float: right; - color: $notifColorLight; + color: var(--notifColorLight); } ._notif-link, @@ -69,13 +69,13 @@ &::-webkit-scrollbar { width: 10px !important; } &::-webkit-scrollbar-track { - background: $notifBackground !important; + background: var(--notifBackground) !important; border: 0 !important; border-radius: 5px !important; } &::-webkit-scrollbar-thumb { - border: 3px solid $notifBackground !important; + border: 3px solid var(--notifBackground) !important; &:hover, &:active { border-width: 2px !important; } } @@ -90,7 +90,7 @@ > ._news-row { line-height: 1.125rem; font-size: .6875rem; - color: $notifColorLight; + color: var(--notifColorLight); margin-bottom: .25rem; + ._news-row { margin-top: .625rem; } @@ -107,7 +107,7 @@ ._news-date { float: right; margin-left: 1rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } code { @@ -128,9 +128,9 @@ } ._notif-tip { - color: $textColor; - background: $tipBackground; - border: $tipBorder; + color: var(--textColor); + background: var(--tipBackground); + border: var(--tipBorder); - ._notif-info { color: $textColorLight; } + ._notif-info { color: var(--textColorLight); } } diff --git a/assets/stylesheets/components/_page.scss b/assets/stylesheets/components/_page.scss index 99771443..60a970b9 100644 --- a/assets/stylesheets/components/_page.scss +++ b/assets/stylesheets/components/_page.scss @@ -23,7 +23,7 @@ max-width: 100%; margin-bottom: 1em; padding: 1px; - border: 1px dotted $boxBorder; + border: 1px dotted var(--boxBorder); border-radius: 3px; @extend %border-box; } @@ -50,7 +50,7 @@ display: inline-block; vertical-align: top; padding: 0 .5rem; - background: $contentBackground; + background: var(--contentBackground); @extend %internal-link; & + & { margin-left: .75rem; } @@ -66,7 +66,7 @@ clear: both; margin: 2rem 0 1.5rem; font-size: .75rem; - color: $textColorLight; + color: var(--textColorLight); text-align: center; -webkit-font-smoothing: subpixel-antialiased; @@ -78,7 +78,7 @@ display: inline-block; margin: 0; padding: .25rem .75rem; - background: $labelBackground; + background: var(--labelBackground); border-radius: 3px; } diff --git a/assets/stylesheets/components/_path.scss b/assets/stylesheets/components/_path.scss index 1d68936f..5853fa04 100644 --- a/assets/stylesheets/components/_path.scss +++ b/assets/stylesheets/components/_path.scss @@ -1,17 +1,17 @@ ._path { position: absolute; - z-index: $noticeZ - 1; + z-index: var(--headerZ); bottom: 0; - left: $sidebarWidth; + left: var(--sidebarWidth); right: 0; height: 2rem; line-height: 2rem; padding: 0 .375rem; font-size: .875rem; - background: $pathBackground; - box-shadow: inset 0 1px $pathBorder; + background: var(--pathBackground); + box-shadow: inset 0 1px var(--pathBorder); - @media #{$mediumScreen} { left: $sidebarMediumWidth; } + @include mobile { left: var(--sidebarMediumWidth); } ._sidebar-hidden & { left: 0; } @@ -24,7 +24,7 @@ display: inline-block; vertical-align: top; padding: 0 .375rem; - color: $textColor; + color: var(--textColor); text-decoration: none; &:first-child:before { diff --git a/assets/stylesheets/components/_prism.scss b/assets/stylesheets/components/_prism.scss index 405fd436..4d01f8cb 100644 --- a/assets/stylesheets/components/_prism.scss +++ b/assets/stylesheets/components/_prism.scss @@ -1,9 +1,26 @@ +html { + --prismValue: #905; + --prismText: #5e8e01; + --prismOperator: #a67f59; + --prismKeyword: #0070a3; + --prismFunction: #dd4a68; + --prismVariable: #e90; +} +html._theme-dark { + --prismValue: #eb8160; + --prismText: #ddcf88; + --prismOperator: #b1c676; + --prismKeyword: #91b3ed; + --prismFunction: #c79e6b; + --prismVariable: #e9c062; +} + .token.comment, .token.prolog, .token.doctype, .token.cdata, .token.punctuation { - color: $textColorLight; + color: var(--textColorLight); } .namespace { @@ -17,11 +34,7 @@ .token.constant, .token.symbol, .token.deleted { - @if $style == 'dark' { - color: #eb8160; - } @else { - color: #905; - } + color: var(--prismValue); } .token.selector, @@ -30,11 +43,7 @@ .token.char, .token.builtin, .token.inserted { - @if $style == 'dark' { - color: #ddcf88; - } @else { - color: #5e8e01; - } + color: var(--prismText); } .token.operator, @@ -42,44 +51,28 @@ .token.url, .language-css .token.string, .style .token.string { - @if $style == 'dark' { - color: #b1c676; - } @else { - color: #a67f59; - } + color: var(--prismOperator); } .token.atrule, .token.attr-value, .token.keyword { - @if $style == 'dark' { - color: #91b3ed; - } @else { - color: #0070a3; - } + color: var(--prismKeyword); } .token.function { - @if $style == 'dark' { - color: #c79e6b; - } @else { - color: #dd4a68; - } + color: var(--prismFunction); } .token.regex, .token.important, .token.variable { - @if $style == 'dark' { - color: #e9c062; - } @else { - color: #e90; - } + color: var(--prismVariable); } .token.important, .token.bold { - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } .token.italic { diff --git a/assets/stylesheets/components/_settings.scss b/assets/stylesheets/components/_settings.scss index c1134041..86bbf005 100644 --- a/assets/stylesheets/components/_settings.scss +++ b/assets/stylesheets/components/_settings.scss @@ -7,15 +7,15 @@ position: absolute; top: 0; bottom: 0; - z-index: $headerZ; + z-index: var(--headerZ); &._in { display: block; } > ._header { justify-content: space-between; } &._dirty > ._header { - background: $noteGreenBackground; - border-color: $noteGreenBorder; + background: var(--noteGreenBackground); + border-color: var(--noteGreenBorder); } } @@ -37,7 +37,7 @@ padding-right: .5rem; line-height: inherit; font-size: inherit; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); text-align: right; @extend %border-box; } @@ -52,7 +52,7 @@ > small { display: block; - color: $textColorLight; + color: var(--textColorLight); margin-left: 1.75rem; } @@ -62,7 +62,7 @@ } } -@media (max-width: $maxWidth) { +@media (max-width: 80rem) { ._setting-max-width { display: none; } } @@ -80,7 +80,7 @@ line-height: 1.5rem; padding: 0 .75rem; font-size: .875rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); color: inherit; text-align: left; cursor: pointer; @@ -119,12 +119,12 @@ position: relative; vertical-align: top; padding: 0 .75rem; - line-height: $headerHeight; - color: $textColorLight; + line-height: var(--headerHeight); + color: var(--textColorLight); &.active { - color: $textColor; - font-weight: $boldFontWeight; - box-shadow: inset 0 -2px $linkColor; + color: var(--textColor); + font-weight: var(--boldFontWeight); + box-shadow: inset 0 -2px var(--linkColor); } } diff --git a/assets/stylesheets/components/_sidebar.scss b/assets/stylesheets/components/_sidebar.scss index e38ed4d2..8813f92d 100644 --- a/assets/stylesheets/components/_sidebar.scss +++ b/assets/stylesheets/components/_sidebar.scss @@ -4,14 +4,14 @@ ._sidebar { position: absolute; - z-index: $sidebarZ; + z-index: var(--sidebarZ); top: 0; bottom: 0; left: 0; overflow-x: hidden; overflow-y: scroll; - padding-top: $headerHeight; - background: $sidebarBackground; + padding-top: var(--headerHeight); + background: var(--sidebarBackground); background-clip: content-box; -webkit-overflow-scrolling: touch; -ms-overflow-style: none; // IE 10 doesn't support pointer-events @@ -22,13 +22,13 @@ ._overlay-scrollbars & { padding-top: 0; - top: $headerHeight; + top: var(--headerHeight); } body:not(._native-scrollbars) & { &::-webkit-scrollbar { width: 10px; } &::-webkit-scrollbar-track { - background: $contentBackground; + background: var(--contentBackground); border: 0; } &::-webkit-scrollbar-thumb { @@ -52,10 +52,10 @@ ._resizer { position: absolute; - z-index: $sidebarZ + 1; - top: $headerHeight; - bottom: $headerHeight; - left: $sidebarWidth; + z-index: var(--headerZ); + top: var(--headerHeight); + bottom: var(--headerHeight); + left: var(--sidebarWidth); margin-left: -2px; width: 3px; cursor: col-resize; @@ -72,11 +72,11 @@ margin: 0; padding: 0; list-style: none; - width: $sidebarWidth; - box-shadow: inset -1px 0 $sidebarBorder; + width: var(--sidebarWidth); + box-shadow: inset -1px 0 var(--sidebarBorder); @extend %border-box; - @media #{$mediumScreen} { width: $sidebarMediumWidth; } + @include mobile { width: var(--sidebarMediumWidth); } ._sidebar > & { min-height: 100%; } @@ -89,7 +89,7 @@ padding: 0 .75rem 0 2.125rem; line-height: 2rem; font-size: .75rem; - color: $textColorLight; + color: var(--textColorLight); text-transform: uppercase; cursor: default; } @@ -110,8 +110,8 @@ line-height: 1.5rem; font-size: .875rem; cursor: default; - background: $sidebarBackground; - box-shadow: inset -1px 0 $sidebarBorder; + background: var(--sidebarBackground); + box-shadow: inset -1px 0 var(--sidebarBorder); @extend %truncate-text; &, &:hover { @@ -123,16 +123,16 @@ &.focus:hover, &.active, &.active:hover { - color: $focusText; - background: $focusBackground; - box-shadow: inset -1px 0 $focusBorder; + color: var(--focusText); + background: var(--focusBackground); + box-shadow: inset -1px 0 var(--focusBorder); } &.active, &.active:hover { - color: $selectionText; - background: $selectionBackground; - box-shadow: inset -1px 0 $selectionBorder; + color: var(--selectionText); + background: var(--selectionBackground); + box-shadow: inset -1px 0 var(--selectionBorder); } &:before { @@ -160,7 +160,7 @@ } ._list-count { - color: $textColorLighter; + color: var(--textColorLighter); pointer-events: none; ._list-disabled:hover > & { display: none; } @@ -168,7 +168,7 @@ ._list-enable { display: none; - color: $linkColor; + color: var(--linkColor); cursor: pointer; &:hover { text-decoration: underline; } @@ -188,7 +188,7 @@ ._list-disabled { @extend %_list-dir; - &, &:hover { color: $textColorLight; } + &, &:hover { color: var(--textColorLight); } &:before { opacity: .7; } } @@ -200,11 +200,9 @@ width: 1rem; height: 1rem; cursor: pointer; - fill: black; + fill: var(--absolute); opacity: .4; - @if $style == 'dark' { fill: white; } - &:hover { opacity: .65; } ._list-rdir > & { @@ -239,11 +237,11 @@ // ._list-pagelink { - color: $linkColor; + color: var(--linkColor); cursor: pointer; &:hover { - color: $linkColorHover; + color: var(--linkColorHover); text-decoration: underline; } } @@ -275,9 +273,9 @@ left: .75rem; width: .75rem; height: 1px; - background: rgba($selectionText, .9); - box-shadow: 0 -3px rgba($selectionText, .9), // top line - 0 3px rgba($selectionText, .9); // bottom line + background: var(--transparentSelectionText); + box-shadow: 0 -3px var(--transparentSelectionText), // top line + 0 3px var(--transparentSelectionText); // bottom line } } @@ -289,7 +287,7 @@ padding: .5rem .75rem; line-height: 1.25rem; font-size: .8125rem; - color: $textColorLight; + color: var(--textColorLight); & + & { padding-top: 0; } } @@ -303,9 +301,9 @@ ._list-hover.clone { position: fixed; overflow: visible; - z-index: $hoverZ; + z-index: var(--hoverZ); left: 0; - min-width: $sidebarWidth; + min-width: var(--sidebarWidth); padding: .25rem .75rem; pointer-events: none; -webkit-font-smoothing: subpixel-antialiased; @@ -313,7 +311,7 @@ transform: translate3d(0, 0, 0); @extend %border-box; - @media #{$mediumScreen} { min-width: $sidebarMediumWidth; } + @include mobile { min-width: var(--sidebarMediumWidth); } > ._list-text { display: inline; } @@ -346,10 +344,10 @@ padding: .5rem .75rem .25rem .75rem; line-height: 1.5rem; font-size: .75rem; - font-weight: $bolderFontWeight; - color: $textColorLight; + font-weight: var(--bolderFontWeight); + color: var(--textColorLight); text-transform: uppercase; - background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0)); + background: linear-gradient(to bottom, var(--sidebarBackground), var(--sidebarBackground) 75%, var(--transparentSidebarBackground)); cursor: default; } diff --git a/assets/stylesheets/global/_base.scss b/assets/stylesheets/global/_base.scss index 33c77a5e..b81d5a93 100644 --- a/assets/stylesheets/global/_base.scss +++ b/assets/stylesheets/global/_base.scss @@ -1,9 +1,10 @@ html { height: 100%; font-size: 100%; - background: $documentBackground; + background: #fff; // fallback to show the error message to browsers that don't support CSS variables. + background: var(--documentBackground); - @media #{$mediumScreen} { font-size: 93.75%; } + @include mobile { font-size: 93.75%; } @include print { background: none; } @import 'global/print'; @@ -17,10 +18,11 @@ body { font-weight: normal; font-family: $baseFont; line-height: 1.7; - color: $textColor; + color: $textColor; // fallback to show the error message to browsers that don't support CSS variables. + color: var(--textColor); word-wrap: break-word; overflow-wrap: break-word; - background: $contentBackground; + background: var(--contentBackground); touch-action: manipulation; -webkit-tap-highlight-color: rgba(black, 0); -webkit-touch-callout: none; @@ -29,11 +31,11 @@ body { } a { - color: $linkColor; - text-decoration: $linkTextDecoration; + color: var(--linkColor); + text-decoration: var(--linkTextDecoration); &:hover { - color: $linkColorHover; + color: var(--linkColorHover); text-decoration: underline; } } @@ -47,7 +49,7 @@ img { h1, h2, h3, h4, h5, h6 { margin: 1.5em 0 1em; line-height: 1.3; - font-weight: $bolderFontWeight; + font-weight: var(--bolderFontWeight); } h1 { font-size: 1.5em; } @@ -59,7 +61,7 @@ h5, h6 { font-size: 1em; } p { margin: 0 0 1em; } p:last-child { margin-bottom: 0; } -b, strong { font-weight: $boldFontWeight; } +b, strong { font-weight: var(--boldFontWeight); } small { font-size: .9em; } @@ -79,7 +81,7 @@ li > ul, li > ol, dd > ul, dd > ol { margin: .5em 0; } li > p { margin-bottom: .25em; } dl { margin: 1.5em 0; } -dt { font-weight: $boldFontWeight; } +dt { font-weight: var(--boldFontWeight); } dd { margin: .375em; padding-left: 1em; @@ -91,15 +93,15 @@ dfn, var { font-style: normal; } abbr, acronym, dfn { cursor: help; - border-bottom: 1px dotted $textColor; + border-bottom: 1px dotted var(--textColor); } pre, code, samp, %pre, %code { - font-family: $monoFont; + font-family: var(--monoFont); font-weight: normal; font-style: normal; font-size: .9em; - color: $textColor; + color: var(--textColor); white-space: pre-wrap; direction: ltr; -moz-tab-size: 2; @@ -121,14 +123,14 @@ a > code { color: inherit; } table { margin: 1.5em 0; background: none; - border: 1px solid $boxBorder; + border: 1px solid var(--boxBorder); border-collapse: separate; border-spacing: 0; border-radius: 3px; } caption { - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); padding: 0 .7em .3em; } @@ -142,15 +144,15 @@ th, td { } th { - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); border: 0; - border-bottom: 1px solid $boxBorder; + border-bottom: 1px solid var(--boxBorder); border-radius: 0; @extend %heading-box; &:empty { background: none; } - + th, + td { border-left: 1px solid $boxBorder; } + + th, + td { border-left: 1px solid var(--boxBorder); } tr:first-child > &:first-child { border-top-left-radius: 3px; } tr:first-child > &:last-child { border-top-right-radius: 3px; } @@ -161,10 +163,10 @@ th { } td { - background: $contentBackground; - border-bottom: 1px solid $boxBorderLight; + background: var(--contentBackground); + border-bottom: 1px solid var(--boxBorderLight); - + td { border-left: 1px solid $boxBorderLight; } + + td { border-left: 1px solid var(--boxBorderLight); } tr:last-child > & { border-bottom: 0; } > pre:only-child, > p:only-child, > ul:only-child, > ol:only-child { @@ -190,7 +192,7 @@ input, button { margin: 0; font-family: inherit; font-size: 100%; - color: $textColor; + color: var(--textColor); line-height: normal; @extend %border-box; } @@ -218,6 +220,10 @@ button:focus { outline: -webkit-focus-ring-color auto 5px; } +img, iframe { + background: var(--externalsBackground); +} + input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; @@ -230,9 +236,9 @@ input[type="search"]::-webkit-search-decoration { border: 0 !important; } -::-webkit-input-placeholder { color: $textColorLighter; } -::-moz-placeholder { color: $textColorLighter; opacity: 1; } -:-ms-input-placeholder { color: $textColorLighter; } +::-webkit-input-placeholder { color: var(--textColorLighter); } +::-moz-placeholder { color: var(--textColorLighter); opacity: 1; } +:-ms-input-placeholder { color: var(--textColorLighter); } body:not(._native-scrollbars) { *::-webkit-scrollbar { -webkit-appearance: none; } @@ -243,12 +249,12 @@ body:not(._native-scrollbars) { *::-webkit-scrollbar-corner { display: none; } *::-webkit-scrollbar-track { - background: $contentBackground; - border: 1px solid $contentBackground; + background: var(--contentBackground); + border: 1px solid var(--contentBackground); &:hover { - background: $sidebarBackground; - border-color: $sidebarBorder; + background: var(--sidebarBackground); + border-color: var(--sidebarBorder); } &:vertical { border-width: 0 0 0 1px; } @@ -266,14 +272,14 @@ body:not(._native-scrollbars) { *::-webkit-scrollbar-thumb { min-height: 2rem; - background: $scrollbarColor; + background: var(--scrollbarColor); background-clip: padding-box; border: 5px solid rgba(black, 0); border-radius: 10px; &:hover, &:active { - background-color: $scrollbarColorHover; + background-color: var(--scrollbarColorHover); border-width: 4px; } } diff --git a/assets/stylesheets/global/_classes.scss b/assets/stylesheets/global/_classes.scss index f96f617b..9e6b9332 100644 --- a/assets/stylesheets/global/_classes.scss +++ b/assets/stylesheets/global/_classes.scss @@ -36,15 +36,15 @@ // %box { - background: $boxBackground; - border: 1px solid $boxBorder; + background: var(--boxBackground); + border: 1px solid var(--boxBorder); border-radius: 3px; } %heading-box { - color: $boxHeaderColor; - background: $boxHeaderBackground; - border: 1px solid $boxBorder; + color: var(--boxHeaderColor); + background: var(--boxHeaderBackground); + border: 1px solid var(--boxBorder); border-radius: 3px; } @@ -82,15 +82,15 @@ %note { margin: 1.5rem 0; padding: .5rem .875rem; - background: $noteBackground; - border: 1px solid $noteBorder; + background: var(--noteBackground); + border: 1px solid var(--noteBorder); border-radius: 3px; } %label { margin: 0 1px; padding: 1px 4px 2px; - background: $labelBackground; + background: var(--labelBackground); border-radius: 3px; } @@ -102,35 +102,35 @@ padding-right: .5em; overflow: hidden; font-size: inherit; - color: $boxHeaderColor; - border: 1px solid $boxBorder; + color: var(--boxHeaderColor); + border: 1px solid var(--boxBorder); border-radius: 2px; @extend %label; } %label-yellow { - background: $noteBackground; - border-color: $noteBorder; + background: var(--noteBackground); + border-color: var(--noteBorder); } %note-green, %label-green { - background: $noteGreenBackground; - border-color: $noteGreenBorder; + background: var(--noteGreenBackground); + border-color: var(--noteGreenBorder); } %note-blue, %label-blue { - background: $noteBlueBackground; - border-color: $noteBlueBorder; + background: var(--noteBlueBackground); + border-color: var(--noteBlueBorder); } %note-orange, %label-orange { - background: $noteOrangeBackground; - border-color: $noteOrangeBorder; + background: var(--noteOrangeBackground); + border-color: var(--noteOrangeBorder); } %note-red, %label-red { - background: $noteRedBackground; - border-color: $noteRedBorder; + background: var(--noteRedBackground); + border-color: var(--noteRedBorder); } // @@ -149,12 +149,11 @@ pointer-events: none; // - @if $style == 'dark' { - background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); - } @else { - background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); - } + background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); } } +html._theme-dark %external-link:after { + background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); +} %internal-link:after { content: none !important; } diff --git a/assets/stylesheets/global/_icons.scss.erb b/assets/stylesheets/global/_icons.scss.erb index bfc852f4..b2b22c22 100644 --- a/assets/stylesheets/global/_icons.scss.erb +++ b/assets/stylesheets/global/_icons.scss.erb @@ -22,8 +22,8 @@ %doc-icon { background-image: image-url('sprites/docs@2x.png'); } } -%darkIconFix { - @if $style == 'dark' { +html._theme-dark { + %darkIconFix { filter: invert(100%) grayscale(100%); -webkit-filter: invert(100%) grayscale(100%); } diff --git a/assets/stylesheets/global/_mixins.scss b/assets/stylesheets/global/_mixins.scss index 604b9ac7..8fbb04fa 100644 --- a/assets/stylesheets/global/_mixins.scss +++ b/assets/stylesheets/global/_mixins.scss @@ -7,3 +7,9 @@ @content; } } + +@mixin mobile { + @media (max-width: 800px) { + @content; + } +} diff --git a/assets/stylesheets/global/_print.scss b/assets/stylesheets/global/_print.scss index 5044631e..08c14fd1 100644 --- a/assets/stylesheets/global/_print.scss +++ b/assets/stylesheets/global/_print.scss @@ -25,14 +25,14 @@ ._attribution-p { background: none; - border: 2px solid $boxBorder; + border: 2px solid var(--boxBorder); } ._attribution:last-child:after { content: 'Exported from DevDocs \2014 https://devdocs.io'; display: block; margin-top: 1rem; - font-weight: $bolderFontWeight; + font-weight: var(--bolderFontWeight); } ._attribution { diff --git a/assets/stylesheets/global/_variables-dark.scss b/assets/stylesheets/global/_variables-dark.scss index 17129d9f..b9c88491 100644 --- a/assets/stylesheets/global/_variables-dark.scss +++ b/assets/stylesheets/global/_variables-dark.scss @@ -1,92 +1,76 @@ -$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; -$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; -$boldFontWeight: 500; -$bolderFontWeight: 600; +html._theme-dark { + --absolute: white; -$style: 'dark'; + --documentBackground: #222; + --contentBackground: #33373a; -$maxWidth: 80rem; -$headerHeight: 3rem; -$sidebarWidth: 20rem; -$sidebarMediumWidth: 16rem; + --textColor: #cbd0d0; + --textColorLight: #9da5ad; + --textColorLighter: #77787a; -$documentBackground: #222; -$contentBackground: #33373a; + --externalsBackground: #fff; -$textColor: #cbd0d0; -$textColorLight: #9da5ad; -$textColorLighter: #77787a; -$textColorRed: #f44336; + --inputFocusBorder: transparent; -$inputFocusBorder: false; + --focusBackground: #3f4042; + --focusBorder: #000; + --focusText: #f7f2f2; -$focusBackground: #3f4042; -$focusBorder: #000; -$focusText: #f7f2f2; + --loadingText: #5d6164; -$loadingText: #5d6164; -$splashText: $loadingText; + --selectionBackground: #007acc; + --selectionBorder: #000; -$selectionBackground: #007acc; -$selectionBorder: #000; -$selectionText: #fff; + --highlightBackground: #64675f; -$highlightBackground: #64675f; + --linkColor: var(--textColor); + --linkColorHover: white; + --linkTextDecoration: underline; -$linkColor: $textColor; -$linkColorHover: white; -$linkTextDecoration: underline; + --headerBackground: #1c1c1c; + --headerBorder: #000; + --searchTagBackground: #{darken(#1c1c1c, 5%)}; + --searchBorder: #{darken(#000, 2%)}; -$headerBackground: #1c1c1c; -$headerBorder: #000; + --sidebarBackground: #24282a; + --transparentSidebarBackground: #{rgba(#24282a, 0)}; + --sidebarBorder: #000; -$sidebarBackground: #24282a; -$sidebarBorder: #000; + --scrollbarColor: #6c6c6f; + --scrollbarColorHover: #949697; -$scrollbarColor: #6c6c6f; -$scrollbarColorHover: #949697; + --pathBackground: var(--headerBackground); + --pathBorder: var(--headerBorder); -$pathBackground: $headerBackground; -$pathBorder: $headerBorder; + --noticeBackground: var(--sidebarBackground); + --noticeBorder: var(--sidebarBorder); -$noticeBackground: $sidebarBackground; -$noticeBorder: $sidebarBorder; + --boxBackground: var(--sidebarBackground); + --boxBorder: var(--headerBorder); + --boxBorderLight: var(--headerBorder); + --boxHeaderColor: #dbe4e4; + --boxHeaderBackground: var(--sidebarBackground); -$boxBackground: $sidebarBackground; -$boxBorder: $headerBorder; -$boxBorderLight: $headerBorder; -$boxHeaderColor: #dbe4e4; -$boxHeaderBackground: $sidebarBackground; + --noteBackground: #45474b; + --noteBorder: #000; -$noteBackground: #45474b; -$noteBorder: #000; + --noteGreenBackground: #284a2a; + --noteGreenBorder: #000; -$noteGreenBackground: #284a2a; -$noteGreenBorder: #000; + --noteBlueBackground: #2a4151; + --noteBlueBorder: #000; -$noteBlueBackground: #2a4151; -$noteBlueBorder: #000; + --noteOrangeBackground: #563322; + --noteOrangeBorder: #000; -$noteOrangeBackground: #563322; -$noteOrangeBorder: #000; + --noteRedBackground: #603033; + --noteRedBorder: #000; -$noteRedBackground: #603033; -$noteRedBorder: #000; + --labelBackground: var(--boxBackground); -$labelBackground: $boxBackground; + --notifBackground: #{rgba(#555, .95)}; + --notifBorder: 1px solid #000; -$notifBackground: rgba(#555, .95); -$notifBorder: 1px solid #000; -$notifColor: #fff; -$notifColorLight: #ccc; - -$tipBackground: $notifBackground; -$tipBorder: $notifBorder; - -$mediumScreen: '(max-width: 800px)'; - -$contentZ: 1; -$sidebarZ: 2; -$headerZ: 3; -$noticeZ: 4; -$hoverZ: 5; + --tipBackground: var(--notifBackground); + --tipBorder: var(--notifBorder); +} diff --git a/assets/stylesheets/global/_variables-light.scss b/assets/stylesheets/global/_variables-light.scss new file mode 100644 index 00000000..f2dcb807 --- /dev/null +++ b/assets/stylesheets/global/_variables-light.scss @@ -0,0 +1,76 @@ +html._theme-default { + --absolute: black; + + --documentBackground: #f3f3f3; + --contentBackground: #fff; + + --textColor: #333; + --textColorLight: #666; + --textColorLighter: #888; + + --externalsBackground: #fff; + + --inputFocusBorder: #35b5f4; + + --focusBackground: #e5e5e5; + --focusBorder: #d4d4d4; + --focusText: #000; + + --loadingText: #ccc; + + --selectionBackground: #398df0; + --selectionBorder: #196fc2; + + --highlightBackground: #fffdcd; + + --linkColor: #3377c0; + --linkColorHover: #2f6cb6; + --linkTextDecoration: none; + + --headerBackground: #eee; + --headerBorder: #d7d7d7; + --searchTagBackground: #{darken(#eee, 5%)}; + --searchBorder: #{darken(#d7d7d7, 2%)}; + + --sidebarBackground: #f9f9f9; + --transparentSidebarBackground: #{rgba(#f9f9f9, 0)}; + --sidebarBorder: #e1e1e1; + + --scrollbarColor: #ccc; + --scrollbarColorHover: #999; + + --pathBackground: var(--sidebarBackground); + --pathBorder: var(--sidebarBorder); + + --noticeBackground: #faf9e2; + --noticeBorder: #e2e2c1; + + --boxBackground: #fafafa; + --boxBorder: #d8d8d8; + --boxBorderLight: #e5e5e5; + --boxHeaderColor: var(--textColor); + --boxHeaderBackground: #f5f5f5; + + --noteBackground: #f8f8dd; + --noteBorder: #d3d952; + + --noteGreenBackground: #e7f8e1; + --noteGreenBorder: #89da70; + + --noteBlueBackground: #d4f3fd; + --noteBlueBorder: #94bbeb; + + --noteOrangeBackground: #fbe6d1; + --noteOrangeBorder: #ec8b01; + + --noteRedBackground: #fed5d3; + --noteRedBorder: #dc7874; + + --labelBackground: #f4f4f4; + + --notifBackground: #{rgba(#333, .85)}; + --notifBorder: none; + + --tipBackground: #{rgba(#fffdcd, .95)}; + --tipBorder: 1px solid #e7dca9; +} diff --git a/assets/stylesheets/global/_variables.scss b/assets/stylesheets/global/_variables.scss index bbdedf9f..c4d8235d 100644 --- a/assets/stylesheets/global/_variables.scss +++ b/assets/stylesheets/global/_variables.scss @@ -1,92 +1,35 @@ +// Variables needed to style the error message for browsers that don't support CSS variables. $baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; -$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; -$boldFontWeight: 500; -$bolderFontWeight: 600; - -$style: 'light'; - -$maxWidth: 80rem; -$headerHeight: 3rem; -$sidebarWidth: 20rem; -$sidebarMediumWidth: 16rem; - -$documentBackground: #f3f3f3; -$contentBackground: #fff; - $textColor: #333; -$textColorLight: #666; -$textColorLighter: #888; -$textColorRed: #f44336; - -$inputFocusBorder: #35b5f4; - -$focusBackground: #e5e5e5; -$focusBorder: #d4d4d4; -$focusText: #000; - -$loadingText: #ccc; -$splashText: #ccc; - -$selectionBackground: #398df0; -$selectionBorder: #196fc2; -$selectionText: #fff; - -$highlightBackground: #fffdcd; - -$linkColor: #3377c0; -$linkColorHover: #2f6cb6; -$linkTextDecoration: none; - -$headerBackground: #eee; -$headerBorder: #d7d7d7; - -$sidebarBackground: #f9f9f9; -$sidebarBorder: #e1e1e1; - -$scrollbarColor: #ccc; -$scrollbarColorHover: #999; - -$pathBackground: $sidebarBackground; -$pathBorder: $sidebarBorder; - -$noticeBackground: #faf9e2; -$noticeBorder: #e2e2c1; - -$boxBackground: #fafafa; -$boxBorder: #d8d8d8; -$boxBorderLight: #e5e5e5; -$boxHeaderColor: $textColor; -$boxHeaderBackground: #f5f5f5; - -$noteBackground: #f8f8dd; -$noteBorder: #d3d952; - -$noteGreenBackground: #e7f8e1; -$noteGreenBorder: #89da70; -$noteBlueBackground: #d4f3fd; -$noteBlueBorder: #94bbeb; +html { + --baseFont: #{$baseFont}; + --monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; + --boldFontWeight: 500; + --bolderFontWeight: 600; -$noteOrangeBackground: #fbe6d1; -$noteOrangeBorder: #ec8b01; + --textColorRed: #f44336; -$noteRedBackground: #fed5d3; -$noteRedBorder: #dc7874; + --splashText: var(--loadingText); -$labelBackground: #f4f4f4; + --selectionText: #fff; + --transparentSelectionText: rgba(255, 255, 255, 0.9); -$notifBackground: rgba(#333, .85); -$notifBorder: none; -$notifColor: #fff; -$notifColorLight: #ccc; + --notifColor: #fff; + --notifColorLight: #ccc; -$tipBackground: rgba(#fffdcd, .95); -$tipBorder: 1px solid #e7dca9; + --maxWidth: 80rem; + --headerHeight: 3rem; + --sidebarWidth: 20rem; + --sidebarMediumWidth: 16rem; -$mediumScreen: '(max-width: 800px)'; + --focusBackground: #e5e5e5; + --focusBorder: #d4d4d4; + --focusText: #000; -$contentZ: 1; -$sidebarZ: 2; -$headerZ: 3; -$noticeZ: 4; -$hoverZ: 5; + --contentZ: 1; + --sidebarZ: 2; + --headerZ: 3; + --noticeZ: 4; + --hoverZ: 5; +} diff --git a/assets/stylesheets/pages/_angularjs.scss b/assets/stylesheets/pages/_angularjs.scss index 5b6df0bc..13f85796 100644 --- a/assets/stylesheets/pages/_angularjs.scss +++ b/assets/stylesheets/pages/_angularjs.scss @@ -8,7 +8,7 @@ .nav-index-section { margin: 1.5em 0 1em -2em; list-style: none; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); text-transform: capitalize; } diff --git a/assets/stylesheets/pages/_async.scss b/assets/stylesheets/pages/_async.scss index 09d018f5..c8961dfd 100644 --- a/assets/stylesheets/pages/_async.scss +++ b/assets/stylesheets/pages/_async.scss @@ -3,13 +3,13 @@ h3 > .type-signature { float: right; - color: $textColorLight; + color: var(--textColorLight); } h3 > .signature-attributes { font-size: .75rem; font-weight: normal; font-style: italic; - color: $textColorLighter; + color: var(--textColorLighter); } } diff --git a/assets/stylesheets/pages/_bash.scss b/assets/stylesheets/pages/_bash.scss index b6ca1808..8d3f6dd7 100644 --- a/assets/stylesheets/pages/_bash.scss +++ b/assets/stylesheets/pages/_bash.scss @@ -5,7 +5,7 @@ } th[align=left] { - border-left: 1px solid $boxBorder; + border-left: 1px solid var(--boxBorder); } code { @extend %label; } diff --git a/assets/stylesheets/pages/_bootstrap.scss b/assets/stylesheets/pages/_bootstrap.scss index 0deb79b7..fbd885ea 100644 --- a/assets/stylesheets/pages/_bootstrap.scss +++ b/assets/stylesheets/pages/_bootstrap.scss @@ -4,7 +4,7 @@ h4 > code, h5 > code, strong > code { @extend %label; } h2 > small { - color: $textColorLight; + color: var(--textColorLight); float: right; } diff --git a/assets/stylesheets/pages/_c.scss b/assets/stylesheets/pages/_c.scss index b9c4c25f..9aeafdcb 100644 --- a/assets/stylesheets/pages/_c.scss +++ b/assets/stylesheets/pages/_c.scss @@ -23,7 +23,7 @@ .t-spar { // language/switch, language/for, etc. font-style: italic; - color: $textColorLight; + color: var(--textColorLight); } .t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; } @@ -57,7 +57,7 @@ margin: 1rem 0; padding: .375rem; font-size: .75rem; - border: 1px solid $boxBorder; + border: 1px solid var(--boxBorder); border-radius: 2px; } diff --git a/assets/stylesheets/pages/_clojure.scss b/assets/stylesheets/pages/_clojure.scss index 9f5e5db4..c1b2647c 100644 --- a/assets/stylesheets/pages/_clojure.scss +++ b/assets/stylesheets/pages/_clojure.scss @@ -5,6 +5,6 @@ .type { float: right; font-size: .9em; - color: $textColorLight; + color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_d.scss b/assets/stylesheets/pages/_d.scss index a32e84b0..7e672145 100644 --- a/assets/stylesheets/pages/_d.scss +++ b/assets/stylesheets/pages/_d.scss @@ -2,10 +2,10 @@ h2 { @extend %block-heading; } h3, .d_decl { @extend %block-label, %label-blue; } .d_decl { @extend %code; } - .d_decl > small { color: $textColorLight; } - .d_decl > strong { font-weight: $bolderFontWeight; } + .d_decl > small { color: var(--textColorLight); } + .d_decl > strong { font-weight: var(--bolderFontWeight); } p > code, li > code, td > code, dd > code { @extend %label; } - span.red { color: $textColorRed; } + span.red { color: var(--textColorRed); } } diff --git a/assets/stylesheets/pages/_dart.scss b/assets/stylesheets/pages/_dart.scss index 3c011db7..fedd9883 100644 --- a/assets/stylesheets/pages/_dart.scss +++ b/assets/stylesheets/pages/_dart.scss @@ -6,7 +6,7 @@ .features { float: right; - color: $textColorLight; + color: var(--textColorLight); } } } diff --git a/assets/stylesheets/pages/_dojo.scss b/assets/stylesheets/pages/_dojo.scss index bb24b223..d22b1f81 100644 --- a/assets/stylesheets/pages/_dojo.scss +++ b/assets/stylesheets/pages/_dojo.scss @@ -1,5 +1,5 @@ ._dojo { @extend %simple; - .jsdoc-inheritance { color: $textColorLight; } + .jsdoc-inheritance { color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_ember.scss b/assets/stylesheets/pages/_ember.scss index 636b56b6..9b3f4689 100644 --- a/assets/stylesheets/pages/_ember.scss +++ b/assets/stylesheets/pages/_ember.scss @@ -5,7 +5,7 @@ h3 > .access { float: right; - color: $textColorLight; + color: var(--textColorLight); font-weight: normal; } @@ -15,6 +15,6 @@ } p.github-link { - color: $textColorLight; + color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_erlang.scss b/assets/stylesheets/pages/_erlang.scss index ba221ec7..1b76cf6d 100644 --- a/assets/stylesheets/pages/_erlang.scss +++ b/assets/stylesheets/pages/_erlang.scss @@ -5,5 +5,5 @@ code.code { @extend %label; } .note { @extend %note; } .warning { @extend %note, %note-red; } - .note .label, .warning .label { font-weight: $boldFontWeight; } + .note .label, .warning .label { font-weight: var(--boldFontWeight); } } diff --git a/assets/stylesheets/pages/_jquery.scss b/assets/stylesheets/pages/_jquery.scss index 4858f4ef..d1a62a1c 100644 --- a/assets/stylesheets/pages/_jquery.scss +++ b/assets/stylesheets/pages/_jquery.scss @@ -32,7 +32,7 @@ .toc-list { margin-top: 0; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); > li + li { margin-top: 1em; } > li > ul { font-weight: normal; } @@ -48,7 +48,7 @@ .returns, .option-type { float: right; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); margin-left: 1em; } diff --git a/assets/stylesheets/pages/_love.scss b/assets/stylesheets/pages/_love.scss index a1908523..b037527f 100644 --- a/assets/stylesheets/pages/_love.scss +++ b/assets/stylesheets/pages/_love.scss @@ -12,6 +12,6 @@ .smwtable { width: 100%; } .smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; } - .cell-green { background: $noteGreenBackground; } - .cell-red { background: $noteRedBackground; } + .cell-green { background: var(--noteGreenBackground); } + .cell-red { background: var(--noteRedBackground); } } diff --git a/assets/stylesheets/pages/_mdn.scss b/assets/stylesheets/pages/_mdn.scss index b1f89f4f..d2b9b643 100644 --- a/assets/stylesheets/pages/_mdn.scss +++ b/assets/stylesheets/pages/_mdn.scss @@ -7,7 +7,7 @@ > span { display: block; font-size: 1rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } ul, ol { @@ -42,7 +42,7 @@ > .note { em { font-style: normal; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } > ul { margin: 1em 0; } @@ -93,7 +93,7 @@ dt > strong > code, // HTML element attribute dl > dt > code { // CSS property value, Javascript function argument font-family: inherit; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); font-size: inherit; } diff --git a/assets/stylesheets/pages/_meteor.scss b/assets/stylesheets/pages/_meteor.scss index adb0121e..5497239f 100644 --- a/assets/stylesheets/pages/_meteor.scss +++ b/assets/stylesheets/pages/_meteor.scss @@ -9,10 +9,10 @@ dt > code { @extend %label; } .api-heading { overflow: hidden; } - .api-heading > code { font-weight: $boldFontWeight; } + .api-heading > code { font-weight: var(--boldFontWeight); } .locus, .src-code { float: right; } .locus, .type, .src-code { margin-left: .5em; } h2 .subtext-api { margin-top: .25rem; } .locus, .subtext-api, .subtext-api > code { font-size: .75rem; } - .locus, .type { color: $textColorLight; } + .locus, .type { color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_npm.scss b/assets/stylesheets/pages/_npm.scss index 9bbcc74c..bdb4482d 100644 --- a/assets/stylesheets/pages/_npm.scss +++ b/assets/stylesheets/pages/_npm.scss @@ -8,7 +8,7 @@ .faint.heading { font-size: .9em; - color: $textColorLight; + color: var(--textColorLight); } .youtube-video iframe { width: 420px; height: 315px; } diff --git a/assets/stylesheets/pages/_phalcon.scss b/assets/stylesheets/pages/_phalcon.scss index 646cf07c..60a32758 100644 --- a/assets/stylesheets/pages/_phalcon.scss +++ b/assets/stylesheets/pages/_phalcon.scss @@ -3,6 +3,6 @@ h3 > small { float: right; - color: $textColorLight; + color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_php.scss b/assets/stylesheets/pages/_php.scss index 319ac647..c6fd4d6b 100644 --- a/assets/stylesheets/pages/_php.scss +++ b/assets/stylesheets/pages/_php.scss @@ -13,7 +13,7 @@ .verinfo { float: right; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } .classsynopsis, @@ -21,7 +21,7 @@ .description > .methodsynopsis, .description > .fieldsynopsis { @extend %note, %note-blue; } - .classsynopsisinfo_comment { color: $textColorLight; } + .classsynopsisinfo_comment { color: var(--textColorLight); } .classsynopsisinfo_comment, .classsynopsis > .constructorsynopsis, diff --git a/assets/stylesheets/pages/_postgres.scss b/assets/stylesheets/pages/_postgres.scss index 69e202c1..7c42a001 100644 --- a/assets/stylesheets/pages/_postgres.scss +++ b/assets/stylesheets/pages/_postgres.scss @@ -16,7 +16,7 @@ } p > code { @extend %label; } - p.c2 { font-weight: $boldFontWeight; } + p.c2 { font-weight: var(--boldFontWeight); } .navfooter > table { width: 100%; } td[align=center] { text-align: center; } diff --git a/assets/stylesheets/pages/_qt.scss b/assets/stylesheets/pages/_qt.scss index db2554ce..360776c0 100644 --- a/assets/stylesheets/pages/_qt.scss +++ b/assets/stylesheets/pages/_qt.scss @@ -4,6 +4,6 @@ // Function headers h3.fn > code { float: right; - color: $textColorLight; + color: var(--textColorLight); } } diff --git a/assets/stylesheets/pages/_rdoc.scss b/assets/stylesheets/pages/_rdoc.scss index f1c8b2cb..7873900a 100644 --- a/assets/stylesheets/pages/_rdoc.scss +++ b/assets/stylesheets/pages/_rdoc.scss @@ -6,7 +6,7 @@ .method-description > h2, h3, h4, h5, h6 { font-size: 1em; } .method-heading { - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); @extend %block-label, %label-blue; + .method-heading { margin-top: -.5em; } @@ -22,7 +22,7 @@ a.method-click-advice { float: right; font-size: .75rem; - color: $linkColor; + color: var(--linkColor); cursor: pointer; @extend %user-select-none; @@ -42,8 +42,8 @@ top: 0; left: -1em; right: 0; - background: rgba($contentBackground, .95); - box-shadow: 0 1em 1em 1em $contentBackground; + background: var(--contentBackground); + box-shadow: 0 1em 1em 1em var(--contentBackground); > pre { margin: 0; } } diff --git a/assets/stylesheets/pages/_react_native.scss b/assets/stylesheets/pages/_react_native.scss index ee4d1c67..1345a35f 100644 --- a/assets/stylesheets/pages/_react_native.scss +++ b/assets/stylesheets/pages/_react_native.scss @@ -2,7 +2,7 @@ @extend %simple; .deprecated { @extend %note, %note-orange; } - .deprecatedTitle { font-weight: $boldFontWeight; } + .deprecatedTitle { font-weight: var(--boldFontWeight); } span.platform { float: right; } span.propType, span.platform { font-weight: normal; } diff --git a/assets/stylesheets/pages/_redis.scss b/assets/stylesheets/pages/_redis.scss index 3ed1837c..e4541f8b 100644 --- a/assets/stylesheets/pages/_redis.scss +++ b/assets/stylesheets/pages/_redis.scss @@ -14,7 +14,7 @@ .args { font-size: .75rem; - color: $textColorLight; + color: var(--textColorLight); } // Others @@ -35,7 +35,7 @@ > .prompt { float: left; margin-right: .5em; - color: $textColorLight; + color: var(--textColorLight); } > code { diff --git a/assets/stylesheets/pages/_rfc.scss b/assets/stylesheets/pages/_rfc.scss index b522b308..eab55beb 100644 --- a/assets/stylesheets/pages/_rfc.scss +++ b/assets/stylesheets/pages/_rfc.scss @@ -10,6 +10,6 @@ > h1, > h2, > h3, > h4, > h5 { margin: 0; - font-family: $baseFont; + font-family: var(--baseFont); } } diff --git a/assets/stylesheets/pages/_rust.scss b/assets/stylesheets/pages/_rust.scss index f7f3c90c..fdf80bb1 100644 --- a/assets/stylesheets/pages/_rust.scss +++ b/assets/stylesheets/pages/_rust.scss @@ -3,9 +3,18 @@ h4 { @extend %block-label; } .docblock { margin-left: 1em; } + div.information, div.important-traits { + @extend %note; + + > pre { margin: .5rem 0; } + } div.stability { margin-bottom: 1em; } em.stab, span.stab { @extend %label; } em.stab.unstable, span.stab.unstable { @extend %label-orange; } - .since, .out-of-band { float: right; } + .out-of-band { float: right; } + .since, .srclink { + float: right; + margin-left: .5rem; + } } diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index fe36579d..64157a86 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -17,34 +17,4 @@ blockquote > h4, blockquote > h5 { margin-top: .25rem; } } -._apache_pig, -._bower, -._chai, -._codeceptjs, -._docker, -._electron, -._fish, -._flow, -._gnu, -._grunt, -._haxe, -._immutable, -._influxdata, -._jasmine, -._jest, -._less, -._lodash, -._marionette, -._markdown, -._mocha, -._mongoose, -._nim, -._redux, -._requirejs, -._simple, -._typescript, -._vagrant, -._vulkan, -._yarn { - @extend %simple; -} +._simple { @extend %simple; } diff --git a/assets/stylesheets/pages/_sphinx.scss b/assets/stylesheets/pages/_sphinx.scss index 86744e33..ffd71415 100644 --- a/assets/stylesheets/pages/_sphinx.scss +++ b/assets/stylesheets/pages/_sphinx.scss @@ -14,7 +14,7 @@ .versionmodified, span.title, .topic-title { display: block; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } p > code, li > code, dd > code, .docutils > dt > code { @extend %label; } @@ -26,7 +26,7 @@ .admonition-title { float: left; margin: 0 .5em 0 0; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); &:after { content: ':'; } } diff --git a/assets/stylesheets/pages/_sphinx_simple.scss b/assets/stylesheets/pages/_sphinx_simple.scss index 7cb7e0dc..cbee1ea1 100644 --- a/assets/stylesheets/pages/_sphinx_simple.scss +++ b/assets/stylesheets/pages/_sphinx_simple.scss @@ -6,7 +6,7 @@ .admonition.tip { @extend %note-green; } .admonition-title { margin: 0 0 .25rem; - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); } code { @extend %label; } diff --git a/assets/stylesheets/pages/_support_tables.scss b/assets/stylesheets/pages/_support_tables.scss index 0ef0b3d3..1fc45b75 100644 --- a/assets/stylesheets/pages/_support_tables.scss +++ b/assets/stylesheets/pages/_support_tables.scss @@ -24,7 +24,7 @@ } tr.current { - font-weight: $boldFontWeight; + font-weight: var(--boldFontWeight); font-size: 1rem; } diff --git a/assets/stylesheets/pages/_yard.scss b/assets/stylesheets/pages/_yard.scss index 227dd234..bb2fbc47 100644 --- a/assets/stylesheets/pages/_yard.scss +++ b/assets/stylesheets/pages/_yard.scss @@ -1,5 +1,5 @@ ._yard { @extend %simple; - .tag_title { font-weight: $boldFontWeight; } + .tag_title { font-weight: var(--boldFontWeight); } } diff --git a/assets/stylesheets/pages/_yii.scss b/assets/stylesheets/pages/_yii.scss index d8e4bed9..6cb99978 100644 --- a/assets/stylesheets/pages/_yii.scss +++ b/assets/stylesheets/pages/_yii.scss @@ -3,6 +3,6 @@ .detail-header-tag, .detailHeaderTag { float: right; - color: $textColorLight; + color: var(--textColorLight); } } diff --git a/lib/app.rb b/lib/app.rb index af9387bb..dddfd906 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -12,6 +12,8 @@ class App < Sinatra::Application Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json' configure do + use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false + set :sentry_dsn, ENV['SENTRY_DSN'] set :protection, except: [:frame_options, :xss_header] @@ -199,7 +201,6 @@ class App < Sinatra::Application @@manifest_asset_urls ||= [ javascript_path('application', asset_host: false), stylesheet_path('application'), - stylesheet_path('application-dark'), image_path('docs-1.png'), image_path('docs-1@2x.png'), image_path('docs-2.png'), @@ -208,21 +209,6 @@ class App < Sinatra::Application ] end - def main_stylesheet_path - stylesheet_paths[dark_theme? ? :dark : :default] - end - - def alternate_stylesheet_path - stylesheet_paths[dark_theme? ? :default : :dark] - end - - def stylesheet_paths - @@stylesheet_paths ||= { - default: stylesheet_path('application'), - dark: stylesheet_path('application-dark') - } - end - def app_size @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px" end diff --git a/lib/docs/filters/elixir/clean_html.rb b/lib/docs/filters/elixir/clean_html.rb index 6e2bd366..7ff3a86a 100644 --- a/lib/docs/filters/elixir/clean_html.rb +++ b/lib/docs/filters/elixir/clean_html.rb @@ -59,6 +59,7 @@ module Docs css('pre').each do |node| node['data-language'] = 'elixir' + node.content = node.content end end end diff --git a/lib/docs/filters/express/clean_html.rb b/lib/docs/filters/express/clean_html.rb index 97609929..0d9c5127 100644 --- a/lib/docs/filters/express/clean_html.rb +++ b/lib/docs/filters/express/clean_html.rb @@ -42,6 +42,11 @@ module Docs node.parent.content = node.parent.content end + # Fix links to the method reference + css('a').each do |node| + node['href'] = node['href'].sub('4x/api', 'index') + end + doc end end diff --git a/lib/docs/filters/handlebars/clean_html.rb b/lib/docs/filters/handlebars/clean_html.rb new file mode 100644 index 00000000..f99aa1df --- /dev/null +++ b/lib/docs/filters/handlebars/clean_html.rb @@ -0,0 +1,44 @@ +module Docs + class Handlebars + class CleanHtmlFilter < Filter + def call + # Remove the t-shirt shop advertisement + css('#callout').remove + + # The title filter is used to add titles to pages without one, remove original headers + css('h1').remove + + # Remove the link to the issue tracker + css('.issue-tracker').remove + + css('pre').each do |node| + # Remove nested nodes inside pre tags + node.content = node.content + + # Add syntax highlighting + node['data-language'] = 'html' + end + + # Transform 'Learn More' links to headers in the "Getting Started" part of the homepage + # If this step is skipped, that section looks cluttered with 4 sub-sections without any dividers + css('#getting-started + .contents a.more-info').each do |node| + clone = node.clone + + # Move it to the top of the sub-section + node.parent.prepend_child(clone) + + # Turn it into a header + clone.name = 'h3' + + # Remove the "Learn More: " part + clone.content = clone.content[12..-1] + end + + # Remove class attributes from div elements to reduce file size + css('div').remove_attr('class') + + doc + end + end + end +end diff --git a/lib/docs/filters/handlebars/entries.rb b/lib/docs/filters/handlebars/entries.rb new file mode 100644 index 00000000..24d46c6c --- /dev/null +++ b/lib/docs/filters/handlebars/entries.rb @@ -0,0 +1,19 @@ +module Docs + class Handlebars + class EntriesFilter < Docs::EntriesFilter + def get_name + subpath[0..-6].titleize + end + + def get_type + name + end + + def additional_entries + css('h2, h3').to_a.map do |node| + [node.content.strip, node['id'], root_page? ? 'Manual' : nil] + end + end + end + end +end diff --git a/lib/docs/filters/puppeteer/clean_html.rb b/lib/docs/filters/puppeteer/clean_html.rb new file mode 100644 index 00000000..d9f6460f --- /dev/null +++ b/lib/docs/filters/puppeteer/clean_html.rb @@ -0,0 +1,24 @@ +module Docs + class Puppeteer + class CleanHtmlFilter < Filter + def call + at_css('h1').content = 'Puppeteer Documentation' + + # None of the elements to remove have classes, so the order of the remove calls is trivial + + # Remove links to previous versions of the reference + at_css('h1 + ul').remove + + # Remove table of contents + at_css('h1 + h5').remove + at_css('h1 + ul').remove + + # Make headers bigger by transforming them into a bigger variant + css('h3').each { |node| node.name = 'h2' } + css('h4').each { |node| node.name = 'h3' } + + doc + end + end + end +end diff --git a/lib/docs/filters/puppeteer/entries.rb b/lib/docs/filters/puppeteer/entries.rb new file mode 100644 index 00000000..3b1e1ba6 --- /dev/null +++ b/lib/docs/filters/puppeteer/entries.rb @@ -0,0 +1,41 @@ +module Docs + class Puppeteer + class EntriesFilter < Docs::EntriesFilter + # The entire reference is one big page, so get_name and get_type are not necessary + + def additional_entries + entries = [] + + css('h3').each do |node| + name = node.content.split(': ').last + + # Find all sub-items (all h4's between the current h3 and the next) + current = node.next + while !current.nil? && current.name != 'h3' + if current.name == 'h4' + current_name = current.content + + # Prepend events with the class name + if current_name.start_with?('event: ') + current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}" + end + + # Remove arguments from functions + if current_name.include?('(') + current_name = current_name.split('(')[0] + '()' + end + + entries << [current_name, current['id'], name] + end + + current = current.next + end + + entries << [name, node['id'], name] + end + + entries + end + end + end +end diff --git a/lib/docs/filters/python/clean_html.rb b/lib/docs/filters/python/clean_html.rb index db474da8..3209281c 100644 --- a/lib/docs/filters/python/clean_html.rb +++ b/lib/docs/filters/python/clean_html.rb @@ -15,15 +15,17 @@ module Docs def other css('h1').each do |node| - node.content = node.content.sub!(/\A[\d\.]+/) do |str| + node.content = node.content.sub(/\A[\d\.]+/) do |str| rgx = /\A#{str}/ @levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx '' end end - css('h2', 'h3', 'h4').each do |node| - node.inner_html = node.inner_html.remove @levelRegexp + unless @levelRegexp.nil? + css('h2', 'h3', 'h4').each do |node| + node.inner_html = node.inner_html.remove @levelRegexp + end end end end diff --git a/lib/docs/filters/python/entries_v3.rb b/lib/docs/filters/python/entries_v3.rb index 759e244a..2bd06de2 100644 --- a/lib/docs/filters/python/entries_v3.rb +++ b/lib/docs/filters/python/entries_v3.rb @@ -2,16 +2,18 @@ module Docs class Python class EntriesV3Filter < Docs::EntriesFilter REPLACE_TYPES = { - 'Cryptographic' => 'Cryptography', - 'Custom Interpreters' => 'Interpreters', - 'Data Compression & Archiving' => 'Data Compression', - 'Generic Operating System' => 'Operating System', - 'Graphical User Interfaces with Tk' => 'Tk', - 'Internet Data Handling' => 'Internet Data', - 'Internet Protocols & Support' => 'Internet', - 'Interprocess Communication & Networking' => 'Networking', - 'Program Frameworks' => 'Frameworks', - 'Structured Markup Processing Tools' => 'Structured Markup' } + 'contextvars — Context Variables' => 'Context Variables', + 'Cryptographic' => 'Cryptography', + 'Custom Interpreters' => 'Interpreters', + 'Data Compression & Archiving' => 'Data Compression', + 'email — An email & MIME handling package' => 'Email', + 'Generic Operating System' => 'Operating System', + 'Graphical User Interfaces with Tk' => 'Tk', + 'Internet Data Handling' => 'Internet Data', + 'Internet Protocols & Support' => 'Internet', + 'Interprocess Communication & Networking' => 'Networking', + 'Program Frameworks' => 'Frameworks', + 'Structured Markup Processing Tools' => 'Structured Markup' } def get_name name = at_css('h1').content diff --git a/lib/docs/filters/rust/clean_html.rb b/lib/docs/filters/rust/clean_html.rb index 416e6e44..2c062eda 100644 --- a/lib/docs/filters/rust/clean_html.rb +++ b/lib/docs/filters/rust/clean_html.rb @@ -2,8 +2,6 @@ module Docs class Rust class CleanHtmlFilter < Filter def call - puts subpath if at_css('#versioninfo') - if slug.start_with?('book') || slug.start_with?('reference') @doc = at_css('#content main') elsif slug == 'error-index' @@ -29,12 +27,16 @@ module Docs css('.rusttest', '.test-arrow', 'hr').remove + css('.docblock.attributes').each do |node| + node.remove if node.content.include?('#[must_use]') + end + css('a.header').each do |node| node.first_element_child['id'] = node['name'] || node['id'] node.before(node.children).remove end - css('.docblock > h1').each { |node| node.name = 'h4' } + css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' } css('h2.section-header').each { |node| node.name = 'h3' } css('h1.section-header').each { |node| node.name = 'h2' } @@ -44,7 +46,7 @@ module Docs end end - css('> .impl-items', '> .docblock', 'pre > pre').each do |node| + css('> .impl-items', '> .docblock', 'pre > pre', '.tooltiptext', '.tooltip').each do |node| node.before(node.children).remove end @@ -65,6 +67,32 @@ module Docs doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2' at_css('h1').content = 'Rust Documentation' if root_page? + css('.table-display').each do |node| + node.css('td').each do |td| + node.before(td.children) + end + node.remove + end + + css('h2 .important-traits', 'h3 .important-traits', 'h4 .important-traits').each do |node| + content = node.at_css('.content.hidden .content') + node.at_css('.content.hidden').replace(content) if content + node.parent.after(node) + end + + css('code.content').each do |node| + node.name = 'pre' + node.css('.fmt-newline').each do |line| + line.inner_html = line.inner_html + "\n" + end + node.inner_html = node.inner_html.gsub('
', "\n") + node.content = node.content + end + + css('.since + .srclink').each do |node| + node.previous_element.before(node) + end + doc end end diff --git a/lib/docs/filters/rust/entries.rb b/lib/docs/filters/rust/entries.rb index e0b3ecad..eb427eba 100644 --- a/lib/docs/filters/rust/entries.rb +++ b/lib/docs/filters/rust/entries.rb @@ -42,11 +42,14 @@ module Docs entries << [node.content, node['id']] unless node.content.include?('Note:') end else - css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node| - name = node.at_css('.fnname').content - name.prepend "#{self.name}::" - [name, node['id']] - end + css('.method') + .select {|node| !node.at_css('.fnname').nil?} + .map {|node| + name = node.at_css('.fnname').content + name.prepend "#{self.name}::" + [name, node['id']] + } + .uniq {|item| item[0]} end end end diff --git a/lib/docs/scrapers/apache_pig.rb b/lib/docs/scrapers/apache_pig.rb index 32bfa2d1..65897a78 100644 --- a/lib/docs/scrapers/apache_pig.rb +++ b/lib/docs/scrapers/apache_pig.rb @@ -2,7 +2,7 @@ module Docs class ApachePig < UrlScraper self.name = 'Apache Pig' self.slug = 'apache_pig' - self.type = 'apache_pig' + self.type = 'simple' self.links = { home: 'https://pig.apache.org/' } diff --git a/lib/docs/scrapers/bower.rb b/lib/docs/scrapers/bower.rb index a86f5449..b032f1d3 100644 --- a/lib/docs/scrapers/bower.rb +++ b/lib/docs/scrapers/bower.rb @@ -1,7 +1,7 @@ module Docs class Bower < UrlScraper self.name = 'Bower' - self.type = 'bower' + self.type = 'simple' self.release = '1.8.4' self.base_url = 'https://bower.io/docs/' self.root_path = 'api' diff --git a/lib/docs/scrapers/chai.rb b/lib/docs/scrapers/chai.rb index e299771f..9d8aa4d2 100644 --- a/lib/docs/scrapers/chai.rb +++ b/lib/docs/scrapers/chai.rb @@ -1,7 +1,7 @@ module Docs class Chai < UrlScraper self.name = 'Chai' - self.type = 'chai' + self.type = 'simple' self.release = '4.1.0' self.base_url = 'http://chaijs.com' self.root_path = '/api/' diff --git a/lib/docs/scrapers/codeceptjs.rb b/lib/docs/scrapers/codeceptjs.rb index 6fd2798c..7d5e4871 100644 --- a/lib/docs/scrapers/codeceptjs.rb +++ b/lib/docs/scrapers/codeceptjs.rb @@ -1,7 +1,7 @@ module Docs class Codeceptjs < UrlScraper self.name = 'CodeceptJS' - self.type = 'codeceptjs' + self.type = 'simple' self.root_path = 'index.html' self.release = '1.3.1' self.base_url = 'https://codecept.io/' diff --git a/lib/docs/scrapers/docker.rb b/lib/docs/scrapers/docker.rb index a1a6345b..92494f8a 100644 --- a/lib/docs/scrapers/docker.rb +++ b/lib/docs/scrapers/docker.rb @@ -1,6 +1,6 @@ module Docs class Docker < UrlScraper - self.type = 'docker' + self.type = 'simple' self.links = { home: 'https://docker.com/', code: 'https://github.com/docker/docker' diff --git a/lib/docs/scrapers/electron.rb b/lib/docs/scrapers/electron.rb index e71690a3..3cb399f0 100644 --- a/lib/docs/scrapers/electron.rb +++ b/lib/docs/scrapers/electron.rb @@ -1,6 +1,6 @@ module Docs class Electron < UrlScraper - self.type = 'electron' + self.type = 'simple' self.base_url = 'https://electronjs.org/docs' self.release = '2.0.2' self.links = { diff --git a/lib/docs/scrapers/elixir.rb b/lib/docs/scrapers/elixir.rb index 7dbe5644..10d5aac1 100644 --- a/lib/docs/scrapers/elixir.rb +++ b/lib/docs/scrapers/elixir.rb @@ -34,7 +34,7 @@ module Docs end version '1.7' do - self.release = '1.7.2' + self.release = '1.7.3' self.base_urls = [ "https://hexdocs.pm/elixir/#{release}/", "https://hexdocs.pm/eex/#{release}/", diff --git a/lib/docs/scrapers/express.rb b/lib/docs/scrapers/express.rb index 7e2b2f29..0fb4ed14 100644 --- a/lib/docs/scrapers/express.rb +++ b/lib/docs/scrapers/express.rb @@ -2,7 +2,7 @@ module Docs class Express < UrlScraper self.name = 'Express' self.type = 'express' - self.release = '4.16.1' + self.release = '4.16.3' self.base_url = 'http://expressjs.com/en/' self.root_path = '4x/api.html' self.initial_paths = %w( diff --git a/lib/docs/scrapers/fish.rb b/lib/docs/scrapers/fish.rb index ac098d45..5ccfa71c 100644 --- a/lib/docs/scrapers/fish.rb +++ b/lib/docs/scrapers/fish.rb @@ -1,7 +1,7 @@ module Docs class Fish < UrlScraper self.name = 'Fish' - self.type = 'fish' + self.type = 'simple' self.root_path = 'index.html' self.links = { home: 'https://fishshell.com/', diff --git a/lib/docs/scrapers/flow.rb b/lib/docs/scrapers/flow.rb index 94fee822..72c46550 100644 --- a/lib/docs/scrapers/flow.rb +++ b/lib/docs/scrapers/flow.rb @@ -1,6 +1,6 @@ module Docs class Flow < UrlScraper - self.type = 'flow' + self.type = 'simple' self.release = '0.79.1' self.base_url = 'https://flow.org/en/docs/' self.links = { diff --git a/lib/docs/scrapers/gnu.rb b/lib/docs/scrapers/gnu.rb index f920e14e..d3f5e7ba 100644 --- a/lib/docs/scrapers/gnu.rb +++ b/lib/docs/scrapers/gnu.rb @@ -1,6 +1,6 @@ module Docs class Gnu < FileScraper - self.type = 'gnu' + self.type = 'simple' self.root_path = 'index.html' self.abstract = 'true' diff --git a/lib/docs/scrapers/grunt.rb b/lib/docs/scrapers/grunt.rb index 764f6d8f..2201c043 100644 --- a/lib/docs/scrapers/grunt.rb +++ b/lib/docs/scrapers/grunt.rb @@ -1,7 +1,7 @@ module Docs class Grunt < UrlScraper self.name = 'Grunt' - self.type = 'grunt' + self.type = 'simple' self.release = '1.0.1' self.base_url = 'https://gruntjs.com/' self.root_path = 'getting-started' diff --git a/lib/docs/scrapers/handlebars.rb b/lib/docs/scrapers/handlebars.rb new file mode 100644 index 00000000..22935d21 --- /dev/null +++ b/lib/docs/scrapers/handlebars.rb @@ -0,0 +1,23 @@ +module Docs + class Handlebars < UrlScraper + self.name = 'Handlebars.js' + self.slug = 'handlebars' + self.type = 'simple' + self.release = '4.0.12' + self.base_url = 'https://handlebarsjs.com/' + self.links = { + home: 'https://handlebarsjs.com/', + code: 'https://github.com/wycats/handlebars.js/' + } + + html_filters.push 'handlebars/entries', 'handlebars/clean_html', 'title' + + options[:container] = '#contents' + options[:root_title] = 'Handlebars.js' + + options[:attribution] = <<-HTML + © 2011–2017 by Yehuda Katz
+ Licensed under the MIT License. + HTML + end +end diff --git a/lib/docs/scrapers/haxe.rb b/lib/docs/scrapers/haxe.rb index 70a49b0b..33f20b93 100644 --- a/lib/docs/scrapers/haxe.rb +++ b/lib/docs/scrapers/haxe.rb @@ -1,7 +1,7 @@ module Docs class Haxe < UrlScraper self.name = 'Haxe' - self.type = 'haxe' + self.type = 'simple' self.release = '3.4.7' self.base_url = 'https://api.haxe.org/' diff --git a/lib/docs/scrapers/immutable.rb b/lib/docs/scrapers/immutable.rb index 3a316ea8..fa7fb81b 100644 --- a/lib/docs/scrapers/immutable.rb +++ b/lib/docs/scrapers/immutable.rb @@ -2,7 +2,7 @@ module Docs class Immutable < UrlScraper self.name = 'Immutable.js' self.slug = 'immutable' - self.type = 'immutable' + self.type = 'simple' self.release = '3.8.1' self.base_url = 'https://facebook.github.io/immutable-js/docs/' self.links = { diff --git a/lib/docs/scrapers/influxdata.rb b/lib/docs/scrapers/influxdata.rb index ef8ca5d9..6c83b66b 100644 --- a/lib/docs/scrapers/influxdata.rb +++ b/lib/docs/scrapers/influxdata.rb @@ -1,7 +1,7 @@ module Docs class Influxdata < UrlScraper self.name = 'InfluxData' - self.type = 'influxdata' + self.type = 'simple' self.release = '1.3' self.base_url = 'https://docs.influxdata.com/' self.links = { diff --git a/lib/docs/scrapers/jasmine.rb b/lib/docs/scrapers/jasmine.rb index eef52115..bc1ba94d 100644 --- a/lib/docs/scrapers/jasmine.rb +++ b/lib/docs/scrapers/jasmine.rb @@ -1,6 +1,6 @@ module Docs class Jasmine < UrlScraper - self.type = 'jasmine' + self.type = 'simple' self.release = '3.2.1' self.base_url = 'https://jasmine.github.io/api/3.2/' self.root_path = 'index.html' diff --git a/lib/docs/scrapers/jest.rb b/lib/docs/scrapers/jest.rb index e20f148f..f4ce944f 100644 --- a/lib/docs/scrapers/jest.rb +++ b/lib/docs/scrapers/jest.rb @@ -1,6 +1,6 @@ module Docs class Jest < UrlScraper - self.type = 'jest' + self.type = 'simple' self.release = '23.5.0' self.base_url = 'https://jestjs.io/docs/en/' self.root_path = 'getting-started' diff --git a/lib/docs/scrapers/laravel.rb b/lib/docs/scrapers/laravel.rb index 33c4ea26..5c88ae0f 100644 --- a/lib/docs/scrapers/laravel.rb +++ b/lib/docs/scrapers/laravel.rb @@ -29,6 +29,19 @@ module Docs Laravel is a trademark of Taylor Otwell. HTML + version '5.7' do + self.release = '5.7.7' + self.root_path = '/api/5.7/index.html' + self.initial_paths = %w(/docs/5.7/installation /api/5.7/classes.html) + + options[:only_patterns] = [%r{\A/api/5\.7/}, %r{\A/docs/5\.7/}] + + options[:fix_urls] = ->(url) do + url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.7/" + url + end + end + version '5.6' do self.release = '5.6.33' self.root_path = '/api/5.6/index.html' diff --git a/lib/docs/scrapers/less.rb b/lib/docs/scrapers/less.rb index bf5c1607..a0947e1a 100644 --- a/lib/docs/scrapers/less.rb +++ b/lib/docs/scrapers/less.rb @@ -1,6 +1,6 @@ module Docs class Less < UrlScraper - self.type = 'less' + self.type = 'simple' self.release = '2.7.2' self.base_url = 'http://lesscss.org' self.root_path = '/features' diff --git a/lib/docs/scrapers/lodash.rb b/lib/docs/scrapers/lodash.rb index fa566e5e..0461f7b7 100644 --- a/lib/docs/scrapers/lodash.rb +++ b/lib/docs/scrapers/lodash.rb @@ -2,7 +2,7 @@ module Docs class Lodash < UrlScraper self.name = 'lodash' self.slug = 'lodash' - self.type = 'lodash' + self.type = 'simple' self.links = { home: 'https://lodash.com/', code: 'https://github.com/lodash/lodash/' diff --git a/lib/docs/scrapers/marionette.rb b/lib/docs/scrapers/marionette.rb index 6171e028..fea6617f 100644 --- a/lib/docs/scrapers/marionette.rb +++ b/lib/docs/scrapers/marionette.rb @@ -2,7 +2,7 @@ module Docs class Marionette < UrlScraper self.name = 'Marionette.js' self.slug = 'marionette' - self.type = 'marionette' + self.type = 'simple' self.root_path = 'index' self.links = { home: 'https://marionettejs.com/', diff --git a/lib/docs/scrapers/markdown.rb b/lib/docs/scrapers/markdown.rb index 6dc7b020..87e9c957 100644 --- a/lib/docs/scrapers/markdown.rb +++ b/lib/docs/scrapers/markdown.rb @@ -1,7 +1,7 @@ module Docs class Markdown < UrlScraper self.name = 'Markdown' - self.type = 'markdown' + self.type = 'simple' self.base_url = 'http://daringfireball.net/projects/markdown/syntax' html_filters.push 'markdown/clean_html', 'markdown/entries' diff --git a/lib/docs/scrapers/mocha.rb b/lib/docs/scrapers/mocha.rb index c358a79b..2e4f5b5b 100644 --- a/lib/docs/scrapers/mocha.rb +++ b/lib/docs/scrapers/mocha.rb @@ -1,6 +1,6 @@ module Docs class Mocha < UrlScraper - self.type = 'mocha' + self.type = 'simple' self.release = '5.0.1' self.base_url = 'https://mochajs.org/' self.links = { diff --git a/lib/docs/scrapers/mongoose.rb b/lib/docs/scrapers/mongoose.rb index d6ca8a01..71ee04d2 100644 --- a/lib/docs/scrapers/mongoose.rb +++ b/lib/docs/scrapers/mongoose.rb @@ -1,7 +1,7 @@ module Docs class Mongoose < UrlScraper self.name = 'Mongoose' - self.type = 'mongoose' + self.type = 'simple' self.release = '4.13.1' self.base_url = 'http://mongoosejs.com/docs/' self.root_path = 'index.html' diff --git a/lib/docs/scrapers/nim.rb b/lib/docs/scrapers/nim.rb index 1077d98e..c21a357e 100644 --- a/lib/docs/scrapers/nim.rb +++ b/lib/docs/scrapers/nim.rb @@ -1,6 +1,6 @@ module Docs class Nim < UrlScraper - self.type = 'nim' + self.type = 'simple' self.release = '0.18.0' self.base_url = 'https://nim-lang.org/docs/' self.root_path = 'overview.html' diff --git a/lib/docs/scrapers/puppeteer.rb b/lib/docs/scrapers/puppeteer.rb new file mode 100644 index 00000000..d83b28d1 --- /dev/null +++ b/lib/docs/scrapers/puppeteer.rb @@ -0,0 +1,18 @@ +module Docs + class Puppeteer < Github + self.release = '1.8.0' + self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md' + self.links = { + code: 'https://github.com/GoogleChrome/puppeteer' + } + + html_filters.push 'puppeteer/entries', 'puppeteer/clean_html' + + options[:container] = '.markdown-body' + + options[:attribution] = <<-HTML + © 2017 Google Inc
+ Licensed under the Apache License 2.0. + HTML + end +end diff --git a/lib/docs/scrapers/redux.rb b/lib/docs/scrapers/redux.rb index 3cd5b330..cd7369ba 100644 --- a/lib/docs/scrapers/redux.rb +++ b/lib/docs/scrapers/redux.rb @@ -1,6 +1,6 @@ module Docs class Redux < UrlScraper - self.type = 'redux' + self.type = 'simple' self.release = '3.7.2' self.base_url = 'http://redux.js.org/docs/' self.links = { diff --git a/lib/docs/scrapers/requirejs.rb b/lib/docs/scrapers/requirejs.rb index 357c58e5..200f1f2d 100644 --- a/lib/docs/scrapers/requirejs.rb +++ b/lib/docs/scrapers/requirejs.rb @@ -1,7 +1,7 @@ module Docs class Requirejs < UrlScraper self.name = 'RequireJS' - self.type = 'requirejs' + self.type = 'simple' self.release = '2.3.5' self.base_url = 'http://requirejs.org/docs/' self.links = { diff --git a/lib/docs/scrapers/rust.rb b/lib/docs/scrapers/rust.rb index ba2f41ed..d960c42b 100644 --- a/lib/docs/scrapers/rust.rb +++ b/lib/docs/scrapers/rust.rb @@ -1,7 +1,7 @@ module Docs class Rust < UrlScraper self.type = 'rust' - self.release = '1.28.0' + self.release = '1.29.1' self.base_url = 'https://doc.rust-lang.org/' self.root_path = 'book/second-edition/index.html' self.initial_paths = %w( diff --git a/lib/docs/scrapers/typescript.rb b/lib/docs/scrapers/typescript.rb index b0db7daf..042bc1fe 100644 --- a/lib/docs/scrapers/typescript.rb +++ b/lib/docs/scrapers/typescript.rb @@ -1,7 +1,7 @@ module Docs class Typescript < UrlScraper self.name = 'TypeScript' - self.type = 'typescript' + self.type = 'simple' self.release = '3.0.1' self.base_url = 'https://www.typescriptlang.org/docs/' self.root_path = 'tutorial.html' diff --git a/lib/docs/scrapers/vagrant.rb b/lib/docs/scrapers/vagrant.rb index 84369b5f..1b54a571 100644 --- a/lib/docs/scrapers/vagrant.rb +++ b/lib/docs/scrapers/vagrant.rb @@ -1,7 +1,7 @@ module Docs class Vagrant < UrlScraper self.name = 'Vagrant' - self.type = 'vagrant' + self.type = 'simple' self.release = '2.1.1' self.base_url = 'https://www.vagrantup.com/docs/' self.root_path = 'index.html' diff --git a/lib/docs/scrapers/vulkan.rb b/lib/docs/scrapers/vulkan.rb index c3b23269..e1fa4b4b 100644 --- a/lib/docs/scrapers/vulkan.rb +++ b/lib/docs/scrapers/vulkan.rb @@ -1,7 +1,7 @@ module Docs class Vulkan < UrlScraper self.name = 'Vulkan' - self.type = 'vulkan' + self.type = 'simple' self.release = '1.0.59' self.base_url = 'https://www.khronos.org/registry/vulkan/specs/1.0/' self.root_path = 'apispec.html' diff --git a/lib/docs/scrapers/yarn.rb b/lib/docs/scrapers/yarn.rb index 72a88d9e..8898d17a 100644 --- a/lib/docs/scrapers/yarn.rb +++ b/lib/docs/scrapers/yarn.rb @@ -1,6 +1,6 @@ module Docs class Yarn < UrlScraper - self.type = 'yarn' + self.type = 'simple' self.release = '1.9.4' self.base_url = 'https://yarnpkg.com/en/docs/' self.links = { diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index a312d714..f8154abe 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -175,9 +175,13 @@ class DocsCLI < Thor private def find_docs(names) - names.map do |name| + names.flat_map do |name| name, version = name.split(/@|~/) - Docs.find(name, version) + if version == 'all' + Docs.find(name, false).versions + else + Docs.find(name, version) + end end end diff --git a/lib/tasks/sprites.thor b/lib/tasks/sprites.thor index bd2ff781..b50f0f04 100644 --- a/lib/tasks/sprites.thor +++ b/lib/tasks/sprites.thor @@ -89,7 +89,7 @@ class SpritesCLI < Thor # Unfortunately, it's not possible to get the value of a SCSS variable from a Thor task # Because hard-coding the value is even worse, we extract it using some regex path = 'assets/stylesheets/global/_variables-dark.scss' - regex = /\$sidebarBackground:\s+([^;]+);/ + regex = /--sidebarBackground:\s+([^;]+);/ ChunkyPNG::Color.parse(File.read(path)[regex, 1]) end diff --git a/public/icons/docs/handlebars/16.png b/public/icons/docs/handlebars/16.png new file mode 100644 index 00000000..b0bba8b0 Binary files /dev/null and b/public/icons/docs/handlebars/16.png differ diff --git a/public/icons/docs/handlebars/16@2x.png b/public/icons/docs/handlebars/16@2x.png new file mode 100644 index 00000000..c9ff8c34 Binary files /dev/null and b/public/icons/docs/handlebars/16@2x.png differ diff --git a/public/icons/docs/handlebars/SOURCE b/public/icons/docs/handlebars/SOURCE new file mode 100644 index 00000000..aa446ef6 --- /dev/null +++ b/public/icons/docs/handlebars/SOURCE @@ -0,0 +1 @@ +https://github.com/yahoo/formatjs-site/tree/master/public/img diff --git a/public/icons/docs/puppeteer/16.png b/public/icons/docs/puppeteer/16.png new file mode 100644 index 00000000..1a15e128 Binary files /dev/null and b/public/icons/docs/puppeteer/16.png differ diff --git a/public/icons/docs/puppeteer/16@2x.png b/public/icons/docs/puppeteer/16@2x.png new file mode 100644 index 00000000..cf0c0d8b Binary files /dev/null and b/public/icons/docs/puppeteer/16@2x.png differ diff --git a/public/icons/docs/puppeteer/SOURCE b/public/icons/docs/puppeteer/SOURCE new file mode 100644 index 00000000..73bf4c33 --- /dev/null +++ b/public/icons/docs/puppeteer/SOURCE @@ -0,0 +1 @@ +https://github.com/GoogleChromeLabs/pptr.dev/tree/master/src/favicons diff --git a/public/images/webapp-icon-512.png b/public/images/webapp-icon-512.png new file mode 100644 index 00000000..1824be8f Binary files /dev/null and b/public/images/webapp-icon-512.png differ diff --git a/public/manifest.json b/public/manifest.json index c3ddeca4..1faa5978 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -29,6 +29,11 @@ "src": "/images/webapp-icon-256.png", "sizes": "256x256", "type": "image/png" + }, + { + "src": "/images/webapp-icon-512.png", + "sizes": "512x512", + "type": "image/png" } ] } diff --git a/test/app_test.rb b/test/app_test.rb index 5401e3ae..77975a9d 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -11,6 +11,16 @@ class AppTest < MiniTest::Spec App end + before do + current_session.env('HTTPS', 'on') + end + + it 'redirects to HTTPS' do + get 'http://example.com/test?q=1', {}, 'HTTPS' => 'off' + assert last_response.redirect? + assert_equal 'https://example.com/test?q=1', last_response['Location'] + end + describe "/" do it "works" do get '/' @@ -20,13 +30,13 @@ class AppTest < MiniTest::Spec it "redirects to /#q= when there is a 'q' query param" do get '/search', q: 'foo' assert last_response.redirect? - assert_equal 'http://example.org/#q=foo', last_response['Location'] + assert_equal 'https://example.org/#q=foo', last_response['Location'] end it "redirects without the query string" do get '/', foo: 'bar' assert last_response.redirect? - assert_equal 'http://example.org/', last_response['Location'] + assert_equal 'https://example.org/', last_response['Location'] end it "sets default size" do @@ -45,6 +55,18 @@ class AppTest < MiniTest::Spec get '/' assert_includes last_response.body, '' end + + it "sets the theme from cookie" do + get '/' + assert_match %r{]*class="[^\"]*_theme-default}, last_response.body + refute_includes last_response.body, '_theme-dark' + + set_cookie('dark=1') + + get '/' + assert_match %r{]*class="[^\"]*_theme-dark}, last_response.body + refute_includes last_response.body, '_theme-default' + end end describe "/[static-page]" do @@ -52,7 +74,7 @@ class AppTest < MiniTest::Spec %w(offline about news help).each do |page| get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER assert last_response.redirect? - assert_equal "http://example.org/#/#{page}", last_response['Location'] + assert_equal "https://example.org/#/#{page}", last_response['Location'] end end @@ -61,7 +83,7 @@ class AppTest < MiniTest::Spec set_cookie('foo=bar') get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER assert last_response.redirect? - assert_equal 'http://example.org/', last_response['Location'] + assert_equal 'https://example.org/', last_response['Location'] assert last_response['Set-Cookie'].start_with?("initial_path=%2F#{page}; path=/; expires=") end end @@ -71,11 +93,11 @@ class AppTest < MiniTest::Spec it "redirects to /#q=" do get '/search' assert last_response.redirect? - assert_equal 'http://example.org/#q=', last_response['Location'] + assert_equal 'https://example.org/#q=', last_response['Location'] get '/search', q: 'foo' assert last_response.redirect? - assert_equal 'http://example.org/#q=foo', last_response['Location'] + assert_equal 'https://example.org/#q=foo', last_response['Location'] end end @@ -148,7 +170,7 @@ class AppTest < MiniTest::Spec set_cookie('docs=html~5') get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER assert last_response.redirect? - assert_equal 'http://example.org/', last_response['Location'] + assert_equal 'https://example.org/', last_response['Location'] assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%7E5%2F; path=/; expires=") end @@ -161,13 +183,13 @@ class AppTest < MiniTest::Spec set_cookie('docs=html~5') get '/html/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER assert last_response.redirect? - assert_equal 'http://example.org/', last_response['Location'] + assert_equal 'https://example.org/', last_response['Location'] assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%2F; path=/; expires=") end it "renders when the doc exists and is enabled, and the request is from Googlebot" do set_cookie('docs=html') - get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' + get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)' assert last_response.ok? end @@ -187,17 +209,17 @@ class AppTest < MiniTest::Spec it "redirects with trailing slash" do get '/html' assert last_response.redirect? - assert_equal 'http://example.org/html/', last_response['Location'] + assert_equal 'https://example.org/html/', last_response['Location'] get '/html', bar: 'baz' assert last_response.redirect? - assert_equal 'http://example.org/html/?bar=baz', last_response['Location'] + assert_equal 'https://example.org/html/?bar=baz', last_response['Location'] end it "redirects old docs" do get '/iojs/' assert last_response.redirect? - assert_equal 'http://example.org/node/', last_response['Location'] + assert_equal 'https://example.org/node/', last_response['Location'] end end @@ -232,17 +254,17 @@ class AppTest < MiniTest::Spec it "redirects with trailing slash" do get '/css-foo' assert last_response.redirect? - assert_equal 'http://example.org/css-foo/', last_response['Location'] + assert_equal 'https://example.org/css-foo/', last_response['Location'] get '/css-foo', bar: 'baz' assert last_response.redirect? - assert_equal 'http://example.org/css-foo/?bar=baz', last_response['Location'] + assert_equal 'https://example.org/css-foo/?bar=baz', last_response['Location'] end it "redirects old docs" do get '/yii1-foo/' assert last_response.redirect? - assert_equal 'http://example.org/yii~1.1-foo/', last_response['Location'] + assert_equal 'https://example.org/yii~1.1-foo/', last_response['Location'] end end @@ -263,17 +285,17 @@ class AppTest < MiniTest::Spec it "redirects without trailing slash" do get '/css/foo/' assert last_response.redirect? - assert_equal 'http://example.org/css/foo', last_response['Location'] + assert_equal 'https://example.org/css/foo', last_response['Location'] get '/css/foo/', bar: 'baz' assert last_response.redirect? - assert_equal 'http://example.org/css/foo?bar=baz', last_response['Location'] + assert_equal 'https://example.org/css/foo?bar=baz', last_response['Location'] end it "redirects old docs" do get '/python2/foo' assert last_response.redirect? - assert_equal 'http://example.org/python~2.7/foo', last_response['Location'] + assert_equal 'https://example.org/python~2.7/foo', last_response['Location'] end end @@ -281,7 +303,7 @@ class AppTest < MiniTest::Spec it "returns to the asset path" do get '/docs.json' assert last_response.redirect? - assert_equal 'http://example.org/assets/docs.json', last_response['Location'] + assert_equal 'https://example.org/assets/docs.json', last_response['Location'] end end @@ -289,7 +311,7 @@ class AppTest < MiniTest::Spec it "returns to the asset path" do get '/application.js' assert last_response.redirect? - assert_equal 'http://example.org/assets/application.js', last_response['Location'] + assert_equal 'https://example.org/assets/application.js', last_response['Location'] end end @@ -297,7 +319,7 @@ class AppTest < MiniTest::Spec it "returns to the asset path" do get '/application.css' assert last_response.redirect? - assert_equal 'http://example.org/assets/application.css', last_response['Location'] + assert_equal 'https://example.org/assets/application.css', last_response['Location'] end end diff --git a/views/index.erb b/views/index.erb index ce743671..022e927f 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,5 +1,5 @@ - prefix="og: http://ogp.me/ns#" lang="en" class="_booting"> + prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>"> @@ -30,7 +30,7 @@ - + <%= stylesheet_tag 'application' %> > diff --git a/views/other.erb b/views/other.erb index f8c9eee6..ee9b8de1 100644 --- a/views/other.erb +++ b/views/other.erb @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ - + <%= stylesheet_tag 'application' %> data-doc="<%= CGI::escape_html @doc.to_json %>"> diff --git a/views/unsupported.erb b/views/unsupported.erb index b64ffc3d..ca90d4d8 100644 --- a/views/unsupported.erb +++ b/views/unsupported.erb @@ -10,13 +10,10 @@

Your browser is unsupported, sorry.

DevDocs is an API documentation browser which supports the following browsers:

    -
  • Recent versions of Chrome and Firefox
  • -
  • Safari 5.1+
  • -
  • Opera 12.1+
  • -
  • Internet Explorer 10+
  • -
  • iOS 6+
  • -
  • Android 4.1+
  • -
  • Windows Phone 8+
  • +
  • Recent versions of Firefox, Chrome, or Opera
  • +
  • Safari 9.1+
  • +
  • Edge 16+
  • +
  • iOS 10+

If you're unable to upgrade, I apologize.