about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rwxr-xr-x[-rw-r--r--]app/assets/stylesheets/variables.scss16
-rwxr-xr-xapp/helpers/style_helper.rb19
-rwxr-xr-x[-rw-r--r--]app/views/layouts/application.html.haml2
3 files changed, 28 insertions, 9 deletions
diff --git a/app/assets/stylesheets/variables.scss b/app/assets/stylesheets/variables.scss
index cdf81c818..0dded90b0 100644..100755
--- a/app/assets/stylesheets/variables.scss
+++ b/app/assets/stylesheets/variables.scss
@@ -1,8 +1,8 @@
-$color1: #282c37; // darkest
-$color2: #d9e1e8; // lightest
-$color3: #9baec8; // lighter
-$color4: #2b90d9; // vibrant
-$color5: #ffffff; // white
-$color6: #df405a; // error red
-$color7: #79bd9a; // succ green
-$color8: #000000; // black
+$color1: #282c37 !default; // darkest
+$color2: #d9e1e8 !default; // lightest
+$color3: #9baec8 !default; // lighter
+$color4: #2b90d9 !default; // vibrant
+$color5: #ffffff !default; // white
+$color6: #df405a !default; // error red
+$color7: #79bd9a !default; // succ green
+$color8: #000000 !default; // black
diff --git a/app/helpers/style_helper.rb b/app/helpers/style_helper.rb
new file mode 100755
index 000000000..774407b7f
--- /dev/null
+++ b/app/helpers/style_helper.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module StyleHelper
+  def stylesheet_for_layout
+    if asset_exist? 'custom.css'
+      'custom'
+    else
+      'application'
+    end
+  end
+
+  def asset_exist?(path)
+    if Rails.configuration.assets.compile
+      Rails.application.precompiled_assets.include? path
+    else
+      Rails.application.assets_manifest.assets[path].present?
+    end
+  end
+end
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index e8253bd6f..a27c3de95 100644..100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -17,7 +17,7 @@
         = ' - '
       = site_title
 
-    = stylesheet_link_tag 'application', media: 'all'
+    = stylesheet_link_tag stylesheet_for_layout, media: 'all'
     = csrf_meta_tags
 
     = yield :header_tags