DEV: Change path for extra scss files in themes (#7664)

DEV: Change path for extra scss files in themes (#7664)

The preferred path is /stylesheets/..., to match core and plugins. The old /scss/... path will continue to function

diff --git a/app/models/theme_field.rb b/app/models/theme_field.rb
index cceb949..f946204 100644
--- a/app/models/theme_field.rb
+++ b/app/models/theme_field.rb
@@ -379,9 +379,9 @@ class ThemeField < ActiveRecord::Base
     ThemeFileMatcher.new(regex: /^common\/embedded\.scss$/,
                          targets: :common, names: "embedded_scss", types: :scss,
                          canonical: -> (h) { "common/embedded.scss" }),
-    ThemeFileMatcher.new(regex: /^scss\/(?<name>.+)\.scss$/,
+    ThemeFileMatcher.new(regex: /^(?:scss|stylesheets)\/(?<name>.+)\.scss$/,
                          targets: :extra_scss, names: nil, types: :scss,
-                         canonical: -> (h) { "scss/#{h[:name]}.scss" }),
+                         canonical: -> (h) { "stylesheets/#{h[:name]}.scss" }),
     ThemeFileMatcher.new(regex: /^settings\.ya?ml$/,
                          names: "yaml", types: :yaml, targets: :settings,
                          canonical: -> (h) { "settings.yml" }),

GitHub sha: 75fc1262

1 Like

We should probably add a test for that :wink:

1 Like

DEV: Update specs for new stylesheet location