History

Remove redundant server-side styling

Jasper van Merle committed 7 years ago

Commit aaf99041 parent 35dd78f3 files · +4 −16Browse files

Unified · Split

3 files
  1. lib/app.rb +0 −12
  2. views/index.erb +2 −2
  3. views/other.erb +2 −2
lib/app.rb+0−12
@@ -209,18 +209,6 @@ class App < Sinatra::Application · 208 unmodified lines
209209 @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px"
210210 end
211211
212− def app_layout
213− memoized_cookies['layout']
214− end
215−
216− def app_theme
217− @app_theme ||= memoized_cookies['dark'].nil? ? 'default' : 'dark'
218− end
219−
220− def dark_theme?
221− app_theme == 'dark'
222− end
223−
224212 def bypass_cache?
225213 !memoized_cookies['bypassCache'].nil?
226214 end
views/index.erb+2−2
@@ -1,5 +1,5 @@
11 <!DOCTYPE html>
2−<html prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>">
2+<html prefix="og: http://ogp.me/ns#" lang="en" class="_booting">
33 <head>
44 <meta charset="utf-8">
55 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no">
@@ -32,7 +32,7 @@ · 26 unmodified lines
3232 <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0">
3333 <%= stylesheet_tag 'application' %>
3434 </head>
35−<body<%= %( class="#{app_layout}") if app_layout %>>
35+<body>
3636 <noscript class="_fail">DevDocs requires JavaScript to run.</noscript>
3737 <%= erb :app -%>
3838 <%= javascript_tag 'application', asset_host: false %>
views/other.erb+2−2
@@ -1,5 +1,5 @@
11 <!DOCTYPE html>
2−<html lang="en" class="_booting _theme-<%= app_theme %>">
2+<html lang="en" class="_booting">
33 <head>
44 <meta charset="utf-8">
55 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
@@ -13,7 +13,7 @@ · 7 unmodified lines
1313 <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs">
1414 <%= stylesheet_tag 'application' %>
1515 </head>
16−<body<%= %( class="#{app_layout}") if app_layout %> data-doc="<%= CGI::escape_html @doc.to_json %>">
16+<body data-doc="<%= CGI::escape_html @doc.to_json %>">
1717 <noscript class="_fail">DevDocs requires JavaScript to run.</noscript>
1818 <%= erb :app -%>
1919 <%= javascript_tag 'application', asset_host: false %><% unless App.production? %>