FIX: Previewing theme components broken when component has no SCSS.

FIX: Previewing theme components broken when component has no SCSS.

diff --git a/lib/stylesheet/manager.rb b/lib/stylesheet/manager.rb
index 3ce2c06..e871394 100644
--- a/lib/stylesheet/manager.rb
+++ b/lib/stylesheet/manager.rb
@@ -231,7 +231,7 @@ class Stylesheet::Manager
         if is_theme && !has_theme
           next
         else
-          next if builder.theme&.component && !scss_checker.has_scss(theme_id)
+          next if is_theme && builder.theme&.component && !scss_checker.has_scss(theme_id)
           builder.compile unless File.exists?(builder.stylesheet_fullpath)
           href = builder.stylesheet_path(current_hostname)
           cache.defer_set("path_#{target}_#{theme_id}_#{current_hostname}", href)
diff --git a/spec/components/stylesheet/manager_spec.rb b/spec/components/stylesheet/manager_spec.rb
index a4b083a..da6768d 100644
--- a/spec/components/stylesheet/manager_spec.rb
+++ b/spec/components/stylesheet/manager_spec.rb
@@ -135,6 +135,14 @@ describe Stylesheet::Manager do
       )
     end
 
+    it 'outputs tags for non-theme targets for theme component' do
+      child_theme = Fabricate(:theme, component: true)
+
+      hrefs = manager(child_theme.id).stylesheet_details(:desktop, 'all')
+
+      expect(hrefs.count).to eq(1) # desktop
+    end
+
     it 'does not output tags for component targets with no styles' do
       embedded_scss_child = Fabricate(:theme, component: true)
       embedded_scss_child.set_field(target: :common, name: "embedded_scss", value: ".scss{color: red;}")

GitHub sha: 83012b64738a12cdd53a255c452a002b13fd85a6

This commit appears in #13454 which was approved by davidtaylorhq. It was merged by tgxworld.