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 7062521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:36:14+00:00 2026-05-28T04:36:14+00:00

I have a web app built with html5 boilerplate that has multiple skins available.

  • 0

I have a web app built with html5 boilerplate that has multiple skins available.

Each skin is contained in a separate css file, and which skin to use is set via a config file.

At the moment the HTML5 boilerplate build script minifies and renames the first skin, which is in style.css (the default css file), it also minifies the other two css files I have in the same folder, but it doesn’t rename them, this will cause problems with caching on the live server – updates to the other skins won’t be picked up by a user’s web browser when the css files have far-future expiration dates.

Can anyone give me some tips on how to add support for the extra css files?

To clarify, before running the build script I have the following files in my css folder:
style.css
skin2.css
skin3.css

and after running the build script:
e3b847ea91a5666541ef13b4d9e0797342f5fc31.css -> good
skin2.css -> bad
skin3.css -> bad

I’ve pulled out what I believe to be the relevant code from the build script, and added some comments to explain what is going on:

    <!-- copy source file to intermediate directory -->
    <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"/>

    <!-- copy skeleton to concat file -->
    <copy file="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"
          tofile="${dir.intermediate}/${dir.css}/style-concat.css" overwrite="true"/>

    <!-- load the file into a property -->
    <loadfile property="imports" srcfile="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"/>

    <var name="concat-files" value="${file.root.stylesheet}"/>


    <!--minify CSS-->
    <apply executable="java" parallel="false">
        <fileset dir="${dir.intermediate}/${dir.css}/" includes="style-concat.css"/>
        <arg line="-jar"/>
        <arg path="${dir.build.tools}/${tool.yuicompressor}"/>
        <srcfile/>
        <arg line="-o"/>
        <mapper type="merge" to="${basedir}/${dir.intermediate}/${dir.css}/style-concat.min.css"/>
        <targetfile/>
    </apply>

<!--calculate checksum of css file (this is used for filename)-->
    <checksum file="${dir.intermediate}/${dir.css}/style-concat.min.css" algorithm="sha" property="css.sha" />
    <if>
        <isset property="gae.css_dir" />
        <then>
            <property name="style.css" value="${gae.css_dir}/${css.sha}.css" />
        </then>
        <else>
            <property name="style.css" value="${dir.css}/${css.sha}.css" />
        </else>
    </if>
    <copy file="${dir.intermediate}/${dir.css}/style-concat.min.css" tofile="${dir.publish}/${dir.css}/${css.sha}.css" />

    <!--minify REMAINING CSS files (my other skins)-->

    <apply executable="java" parallel="false">
        <fileset dir="${dir.source}/${dir.css}/" excludes="${concat-files}" includes="**/*.css"/>
        <arg line="-jar"/>
        <arg path="${dir.build.tools}/${tool.yuicompressor}"/>
        <srcfile/>
        <arg line="-o"/>
        <mapper type="glob" from="*.css" to="${basedir}/${dir.publish}/${dir.css}/*.css"/>
        <targetfile/>
    </apply>
    <foreach list="${file.stylesheets}" param="css_file" target="-css-remove-concatenated-stylesheets" />   


    <!--replace reference to css in source with new filename-->
    <replaceregexp match="&lt;!-- CSS concatenated [\d\w\s\W]*?!-- end CSS--&gt;" replace="&lt;link rel='stylesheet' href='${style.css}'&gt;" flags="m">
        <fileset dir="${dir.intermediate}" includes="${page-files}"/>
    </replaceregexp>

Full build script is available here: http://pastebin.com/Cm1LzJpE

  • 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-05-28T04:36:15+00:00Added an answer on May 28, 2026 at 4:36 am

    If I understand your buildfile correctly you don’t do the

    <checksum>
     ...
    <copy file="${dir.intermediate}/${dir.css}/style-concat.min.css" tofile="${dir.publish}/${dir.css}/${css.sha}.css" />
    

    part for the skin*.css files. You only do it for the
    style.css.

    After the second apply there is no checksum part. You need to repeat checksumming and copying for every style file too.
    This question might help with this task: Ant: Rename files to include their MD5

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

Sidebar

Related Questions

I have an asp.net mvc app that is built to run as standard web
I have a web app built with iweb kit that looks great in Android
I have a website/web app built with jquery mobile that I am trying to
I have a web app built against asp.net 2.0, but keep getting the following
I have a web app built on Java Servlet technology. I am thinking of
I have a simple web app built in asp.net webforms c# where and how
I have a Python 2.6 web app built on Pylons 0.9.7. The code in
I am a broke college student. I have built a small web app in
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
We have an existing web app built with jQuery Mobile. Our goal is to

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.