Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9217243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:35:42+00:00 2026-06-18T02:35:42+00:00

I have an application that has three different CSS themes and each of those

  • 0

I have an application that has three different CSS themes and each of those themes has a dozen or so color schemes. Everything works fine in development but the asset pipeline is giving me some odd issues.

Essentially I have several files like this

/themes
  /cool-theme
    _theme.scss
    /color-schemes
      red.scss

The idea is I precompile all the *.scss files except the partials (starting with the underscore) since they are included in the SASS. So I am using this code:

stylesheets_directory = "#{Rails.root}/app/assets/stylesheets"
config.assets.precompile += Dir.glob("#{stylesheets_directory}/**/*.scss").
                            map{|f| f[stylesheets_directory.size+1..-1]}.
                            select do |file|
                            if config.assets.precompile.include?(file)
                              puts "Already have #{file}"
                              false
                            elsif File.basename(file)[0...1] == "_"
                              puts "Partial detected #{file}"
                              false
                            else
                              puts "Including #{file}"
                              true
                            end
                          end

The code runs fine and shows an output I expect during assets:precompile. Excludes everything it should and includes everything it should.

The problem is the /public/assets directory never contains the css files for anything other then application.css. It’s missing red.css, blue.css, etc…

What am I overlooking?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:35:43+00:00Added an answer on June 18, 2026 at 2:35 am

    The way the pipeline works for Javascript files and stylesheets is it’s only going to precompile an application.js and application.css file for you by default.
    This is why you have tried to append more assets to the config.assets.precompile Array. You’re on the right track, but have made a few mistakes.

    The File Extension

    You need to rename

    app/assets/stylesheets/themes/cool-theme/color-schemes/red.scss
    

    to

    app/assets/stylesheets/themes/cool-theme/color-schemes/red.css.scss
    

    This tells the pipeline that you want this to be a .css file when it’s finished compiling.

    The Asset Path

    Currently you’re appending a path like

    /Path/To/Your/app/assets/stylesheets/themes/cool-theme/color-schemes/red.scss
    

    to the config.assets.precompile Array. Instead you need to be passing a path in this format

    themes/cool-theme/color-schemes/red.css
    

    When you precompile your assets you’ll see a new themes folder created inside public/assets/ containing the rest of your directory tree, complete with a compiled red.css file.


    I’ll leave fixing your code for appending paths to the config.assets.precompile up to you as you seem more than capable of making the necessary changes outlined above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails application that has three different types of users and I
I have developed an iPhone Application that has three Levels . Those three Levels
I have an application that now has three Areas and each have around eight
I have a system that has three applications (one windows application and two web
In an application that has multiple webviews, is there any way to have the
I have an application that has 2 beans with the same name, but which
We have an application that has a database full of polygons (currently stored as
I have a application that has an activity that shows message logs. The thing
I have an application that has two localization options at the moment through .resx
I have an application that has two threads. The first one (the main thread)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.