From a1e0f387bfc7c01e41c487b598c3828fa89da397 Mon Sep 17 00:00:00 2001 From: Simon Knox Date: Fri, 22 Feb 2019 11:58:37 +1100 Subject: [PATCH] Move highlight themes to subfolder --- app/assets/stylesheets/highlight/{ => themes}/dark.scss | 2 +- app/assets/stylesheets/highlight/{ => themes}/monokai.scss | 2 +- app/assets/stylesheets/highlight/{ => themes}/none.scss | 2 +- .../stylesheets/highlight/{ => themes}/solarized-dark.scss | 2 +- .../highlight/{ => themes}/solarized-light.scss | 2 +- app/assets/stylesheets/highlight/themes/white.scss | 3 +++ app/assets/stylesheets/highlight/white.scss | 3 --- app/views/layouts/_head.html.haml | 2 +- config/application.rb | 7 +------ spec/views/layouts/_head.html.haml_spec.rb | 2 +- 10 files changed, 11 insertions(+), 16 deletions(-) rename app/assets/stylesheets/highlight/{ => themes}/dark.scss (99%) rename app/assets/stylesheets/highlight/{ => themes}/monokai.scss (99%) rename app/assets/stylesheets/highlight/{ => themes}/none.scss (99%) rename app/assets/stylesheets/highlight/{ => themes}/solarized-dark.scss (99%) rename app/assets/stylesheets/highlight/{ => themes}/solarized-light.scss (99%) create mode 100644 app/assets/stylesheets/highlight/themes/white.scss delete mode 100644 app/assets/stylesheets/highlight/white.scss diff --git a/app/assets/stylesheets/highlight/dark.scss b/app/assets/stylesheets/highlight/themes/dark.scss similarity index 99% rename from app/assets/stylesheets/highlight/dark.scss rename to app/assets/stylesheets/highlight/themes/dark.scss index 435c57ab329..16893dd047e 100644 --- a/app/assets/stylesheets/highlight/dark.scss +++ b/app/assets/stylesheets/highlight/themes/dark.scss @@ -1,6 +1,6 @@ /* https://github.com/MozMorris/tomorrow-pygments */ -@import "./common"; +@import "../common"; /* * Dark syntax colors diff --git a/app/assets/stylesheets/highlight/monokai.scss b/app/assets/stylesheets/highlight/themes/monokai.scss similarity index 99% rename from app/assets/stylesheets/highlight/monokai.scss rename to app/assets/stylesheets/highlight/themes/monokai.scss index d09a21d574b..37fe61b925c 100644 --- a/app/assets/stylesheets/highlight/monokai.scss +++ b/app/assets/stylesheets/highlight/themes/monokai.scss @@ -1,6 +1,6 @@ /* https://github.com/richleland/pygments-css/blob/master/monokai.css */ -@import "./common"; +@import "../common"; /* * Monokai Colors diff --git a/app/assets/stylesheets/highlight/none.scss b/app/assets/stylesheets/highlight/themes/none.scss similarity index 99% rename from app/assets/stylesheets/highlight/none.scss rename to app/assets/stylesheets/highlight/themes/none.scss index 3105c4ed6e8..b4217aac37a 100644 --- a/app/assets/stylesheets/highlight/none.scss +++ b/app/assets/stylesheets/highlight/themes/none.scss @@ -2,7 +2,7 @@ * None Syntax Colors */ -@import "./common"; +@import "../common"; @mixin match-line { color: $black-transparent; diff --git a/app/assets/stylesheets/highlight/solarized-dark.scss b/app/assets/stylesheets/highlight/themes/solarized-dark.scss similarity index 99% rename from app/assets/stylesheets/highlight/solarized-dark.scss rename to app/assets/stylesheets/highlight/themes/solarized-dark.scss index 6b1ee4d450c..a4e9eda22c9 100644 --- a/app/assets/stylesheets/highlight/solarized-dark.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-dark.scss @@ -1,6 +1,6 @@ /* https://gist.github.com/qguv/7936275 */ -@import "./common"; +@import "../common"; /* * Solarized dark colors diff --git a/app/assets/stylesheets/highlight/solarized-light.scss b/app/assets/stylesheets/highlight/themes/solarized-light.scss similarity index 99% rename from app/assets/stylesheets/highlight/solarized-light.scss rename to app/assets/stylesheets/highlight/themes/solarized-light.scss index 3e8367754ca..b604d1ccb6c 100644 --- a/app/assets/stylesheets/highlight/solarized-light.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-light.scss @@ -1,6 +1,6 @@ /* https://gist.github.com/qguv/7936275 */ -@import "./common"; +@import "../common"; /* * Solarized light syntax colors diff --git a/app/assets/stylesheets/highlight/themes/white.scss b/app/assets/stylesheets/highlight/themes/white.scss new file mode 100644 index 00000000000..7239086f649 --- /dev/null +++ b/app/assets/stylesheets/highlight/themes/white.scss @@ -0,0 +1,3 @@ +.code.white { + @import "../white_base"; +} diff --git a/app/assets/stylesheets/highlight/white.scss b/app/assets/stylesheets/highlight/white.scss deleted file mode 100644 index 355c8d223f7..00000000000 --- a/app/assets/stylesheets/highlight/white.scss +++ /dev/null @@ -1,3 +0,0 @@ -.code.white { - @import "white_base"; -} diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 8e8dcf1ea35..11e83ddfe64 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -38,7 +38,7 @@ = stylesheet_link_tag 'performance_bar' if performance_bar_enabled? = stylesheet_link_tag 'csslab' if Feature.enabled?(:csslab) - = stylesheet_link_tag "highlight/#{user_color_scheme}", media: "all" + = stylesheet_link_tag "highlight/themes/#{user_color_scheme}", media: "all" = Gon::Base.render_data diff --git a/config/application.rb b/config/application.rb index 67942ae116b..1c11e347281 100644 --- a/config/application.rb +++ b/config/application.rb @@ -147,12 +147,7 @@ module Gitlab config.assets.precompile << "errors.css" config.assets.precompile << "csslab.css" - config.assets.precompile << "highlight/dark.css" - config.assets.precompile << "highlight/monokai.css" - config.assets.precompile << "highlight/solarized-dark.css" - config.assets.precompile << "highlight/solarized-light.css" - config.assets.precompile << "highlight/white.css" - config.assets.precompile << "highlight/none.css" + config.assets.precompile << "highlight/themes/*.css" # Import gitlab-svgs directly from vendored directory config.assets.paths << "#{config.root}/node_modules/@gitlab/svgs/dist" diff --git a/spec/views/layouts/_head.html.haml_spec.rb b/spec/views/layouts/_head.html.haml_spec.rb index 590dbe7da1f..cbb4199954a 100644 --- a/spec/views/layouts/_head.html.haml_spec.rb +++ b/spec/views/layouts/_head.html.haml_spec.rb @@ -67,7 +67,7 @@ describe 'layouts/_head' do render - expect(rendered).to match('') + expect(rendered).to match('') end def stub_helper_with_safe_string(method)