From 7bf37108b10665e6bfd470ec4054ee989528cdc8 Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Tue, 19 Mar 2019 13:36:30 -0400 Subject: [PATCH] Night theme improvements + small fixes (#2114) --- app/assets/stylesheets/articles.scss | 11 +++++++++++ app/assets/stylesheets/ltags/LinkTag.scss | 15 +++++++++------ app/assets/stylesheets/notifications.scss | 1 + app/controllers/page_views_controller.rb | 2 +- app/views/articles/_sidebar_additional.html.erb | 2 +- app/views/layouts/application.html.erb | 1 + 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/articles.scss b/app/assets/stylesheets/articles.scss index a0bfdf4c2..623732899 100644 --- a/app/assets/stylesheets/articles.scss +++ b/app/assets/stylesheets/articles.scss @@ -122,6 +122,8 @@ top: 14px; border: 0px; background: transparent; + background: var(--theme-secondary-color, transparent); + border-radius: 8px; img { height: 24px; } @@ -644,11 +646,13 @@ -webkit-appearance: none; font-family: $helvetica-condensed; color: $medium-gray; + color: var(--theme-secondary-color, $medium-gray); a { &:hover { opacity: 1; } color: $medium-gray; + color: var(--theme-secondary-color, $medium-gray); } img { height: 18px; @@ -944,8 +948,13 @@ display: block; &:hover { background: $light-purple; + background: var(--theme-container-background, $light-purple); } } + &:hover { + background: white; + background: var(--theme-background, white); + } .readinglist-sidebar-subcat { font-weight: bold; font-size: 0.78em; @@ -1268,6 +1277,7 @@ text-align: left; border-radius: 0px; color: $black; + color: var(--theme-color, $black); cursor: pointer; &:hover { background: lighten($bold-blue, 38%); @@ -1382,6 +1392,7 @@ .discuss-list-comment-count { font-size: 0.8em; color: $medium-gray; + color: var(--theme-container-color, $medium-gray); margin-top: 2px; img { width: 20px; diff --git a/app/assets/stylesheets/ltags/LinkTag.scss b/app/assets/stylesheets/ltags/LinkTag.scss index f2da8a12c..e94325bd9 100644 --- a/app/assets/stylesheets/ltags/LinkTag.scss +++ b/app/assets/stylesheets/ltags/LinkTag.scss @@ -1,6 +1,7 @@ @import 'variables'; .ltag__link__link{ - color:#111111 !important; + color:$black !important; + color: var(--theme-color, $black) !important; &:active{ opacity:0.7; } @@ -45,10 +46,12 @@ font-size:0.8em; margin-bottom:0; font-weight:bold; - color: #666666; + color: $medium-gray; + color: var(--theme-secondary-color, $black); a{ - color: #666666; - } + color: $medium-gray; + color: var(--theme-secondary-color, $black); + } } .ltag__link__taglist{ margin:0; @@ -75,11 +78,11 @@ } .ltag__link__content{ h2{ - font-size:calc(1.1em + 1.4vw) !important; + font-size:calc(1.05em + 0.7vw) !important; margin-top:0em !important; margin-bottom:0.4em !important; font-weight:400 !important; - line-height:calc(0.9em + 0.8vw) !important; + line-height:1.22em !important; } h3{ margin-bottom: 0.4em !important; diff --git a/app/assets/stylesheets/notifications.scss b/app/assets/stylesheets/notifications.scss index 8910aa68e..9b0d69f86 100644 --- a/app/assets/stylesheets/notifications.scss +++ b/app/assets/stylesheets/notifications.scss @@ -335,6 +335,7 @@ } .unseen{ background-color: $light-purple; + background:var(--theme-container-accent-background, $light-purple); } } } diff --git a/app/controllers/page_views_controller.rb b/app/controllers/page_views_controller.rb index 6ba287966..c0db23b7b 100644 --- a/app/controllers/page_views_controller.rb +++ b/app/controllers/page_views_controller.rb @@ -20,7 +20,7 @@ class PageViewsController < ApplicationController if user_signed_in? page_view = PageView.where(article_id: params[:id], user_id: current_user.id).last page_view ||= PageView.create(user_id: current_user.id, - article_id: page_view_params[:article_id]) # pageview is sometimes missing if failure on prior creation. + article_id: params[:id]) # pageview is sometimes missing if failure on prior creation. page_view.update_column(:time_tracked_in_seconds, page_view.time_tracked_in_seconds + 15) end head :ok diff --git a/app/views/articles/_sidebar_additional.html.erb b/app/views/articles/_sidebar_additional.html.erb index 712eac617..505d2d6e5 100644 --- a/app/views/articles/_sidebar_additional.html.erb +++ b/app/views/articles/_sidebar_additional.html.erb @@ -145,7 +145,7 @@ <% end %> <% else %> - <% cache("seo-boostable-posts-homepage-xoxo", expires_in: 18.hours) do %> + <% cache("seo-boostable-posts-homepage-xoxoxo", expires_in: 18.hours) do %> <% @boostable_posts = Article.seo_boostable %> <% if @boostable_posts.any? %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 876f39422..463d8f578 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -96,6 +96,7 @@ --theme-top-bar-write-background: #00af81;\ --theme-top-bar-write-color: #fff;\ --theme-container-background: #27374c;\ + --theme-container-accent-background: #384b66;\ --theme-container-background-hover: #37475c;\ --theme-container-color: #fff;\ --theme-container-box-shadow: none;\