Opened 10 years ago

Closed 4 years ago

#9697 closed enhancement (patchwelcome)

CSS Only Build Option

Reported by: rrsIPOV Owned by: Rawld Gill
Priority: low Milestone: 1.13
Component: BuildTools Version: 1.3.2
Keywords: needsreview Cc:
Blocked By: Blocking:

Description

I think the following can be done by setting up a layer file and excluding everything your don't want, but that seems like overkill.

I have a web application that uses 'themes', currently only system administrators can switch themes, although this might change at some point. We have been integrating various dijit widgets into our new themes, using a custom dojo build to create a main JS file to download, but because there are multiple theme.css files each CSS pulled in the dojo and dijit CSS separately. As each theme.css started to get bigger it became more maintainable to break it up into several CSS files specific for a web application component, although most pages use a good bit of the css so it is all still being loaded using @import.

Over the weekend I was searching for ways to keep the CSS in modules during development but package each theme as a single CSS for deployment, and since we are already using the dojo build scripts this seemed like a logical place to start, but I quickly got discuraged by the amount of work to build just CSS, and looked at a couple other options, including the Yahoo build tool, but as far as I can see only the dojo build scripts follow @import statements and create a unified CSS (yeah other tools could concatenate the files, by I'm trying to KISS).

So, I eventually ended up reading through the dojo build scripts and creating a modified version that adds action=css as a valid build action. I know this is kind of on the edge of the dojo space, but to me it seems like a real value for users of the toolkit. Over the weekend I went ahead and sent in both a corporate and personal CLA (I got the response email this morning). I am attaching my patch file.

Example build: java -Xms256m -Xmx512m -classpath ../shrinksafe/js.jar;../shrinksafe/shrinksafe.jar org.mozilla.javascript.tools.shell.Main build.js action=css optimize=shrinksafe cssOptimize=comments cssImportIgnore="../dijit.css" copyTests=false inputDir=C:/bin/wamp/www/ccs-trunk/themes/cosolvent releaseDir=C:/TempWork/dojo-css-output releaseName=

Attachments (2)

css-build-opts.diff (2.9 KB) - added by rrsIPOV 10 years ago.
DIff/Patch file for implementing action=css in build scripts.
css-build-opts-2.diff (2.7 KB) - added by rrsIPOV 10 years ago.
Version 2 of diff, renamed 'inputDir' to 'cssInputDir'

Download all attachments as: .zip

Change History (13)

Changed 10 years ago by rrsIPOV

Attachment: css-build-opts.diff added

DIff/Patch file for implementing action=css in build scripts.

Changed 10 years ago by rrsIPOV

Attachment: css-build-opts-2.diff added

Version 2 of diff, renamed 'inputDir' to 'cssInputDir'

comment:1 Changed 10 years ago by rrsIPOV

While working with this decided 'inputDir' was a little ambiguous, so renamed it to 'cssInputDir' to help denote that the original CSS files come from this directory (if it is specified), and then are copied to the releaseDir before being processed.

comment:2 Changed 10 years ago by James Burke

Thanks for the patch contribution. In what case did you need to set inputCssDir? I would think that the startDir was enough in the optimizeCss method call.

comment:3 Changed 10 years ago by James Burke

Milestone: tbdfuture

comment:4 Changed 7 years ago by bill

Owner: changed from James Burke to Rawld Gill
Status: newassigned

comment:5 Changed 7 years ago by ben hockey

Keywords: needsreview added
Priority: highlow

this patch is outdated now of course - is it worth keeping this ticket open?

comment:6 Changed 7 years ago by cjolif

we do have requests to be able to run this tool in CSS only mode.

comment:7 Changed 7 years ago by Rawld Gill

Resolution: wontfix
Status: assignedclosed

Maybe in 2.0.

comment:8 Changed 7 years ago by cjolif

well if that is maybe in 2.0 and as we do have request for that I'm not sure why we close it?

comment:9 Changed 6 years ago by bill

Resolution: wontfix
Status: closedreopened

I agree, this is the reason trac has a "2.0" milestone.

comment:10 Changed 6 years ago by Rawld Gill

Status: reopenedassigned

comment:11 Changed 4 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: assignedclosed

I think for 2.0, we'll just rely on the relevant CSS preprocessor, so I don't see the point in keeping this ticket open.

Note: See TracTickets for help on using tickets.