CARVIEW |
Hi There! gudmundurh is using GitHub to share code with you!
GitHub is more than just a place to share code. It's a place to keep tabs on your favorite projects, easily contribute fixes and new features, and visualize what's going on inside your codebase!
Every repository with this icon (

Every repository with this icon (

Description: | CSS stylesheet merger written in .NET edit |
Homepage: | edit |
Public Clone URL: |
git://github.com/gudmundurh/CssMerger.git
Give this clone URL to anyone.
git clone git://github.com/gudmundurh/CssMerger.git
|
Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:gudmundurh/CssMerger.git
|
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Tue Jul 21 13:17:08 -0700 2009 | Added .gitignore [gudmundurh] |
![]() |
CssMerger.Tests/ | Thu Jul 23 05:49:30 -0700 2009 | Entry points in CssMerger simplified - note the... [gudmundurh] |
![]() |
CssMerger.sln | Sun Jul 12 07:07:29 -0700 2009 | Switched from VS unit test to NUnit [gudmundurh] |
![]() |
CssMerger/ | Thu Jul 23 05:49:30 -0700 2009 | Entry points in CssMerger simplified - note the... [gudmundurh] |
![]() |
CssMergerApp/ | Thu Jul 23 05:49:30 -0700 2009 | Entry points in CssMerger simplified - note the... [gudmundurh] |
![]() |
IntegrationTests/ | Sun Jul 12 06:50:09 -0700 2009 | Command line app added. Bug in the @import rege... [gudmundurh] |
![]() |
LICENSE.txt | Sun Jul 12 03:34:28 -0700 2009 | Code cleanup. License added. [gudmundurh] |
![]() |
README.textile | Thu Jul 23 05:49:30 -0700 2009 | Entry points in CssMerger simplified - note the... [gudmundurh] |
CSS Merger
The merger follows CSS @import statements and merges imported files into the main file. This allows for dividing CSS files into manageable logical units, but serving a single CSS file at production, thus not sacrifying performance.
The merger takes care to rewrite relative paths to images.
A simple command line application is included (CssMergerApp), but the merger can also be used programatically, most easily by referencing CssMerger and writing
new CssMerger().MergeCss(inputFilename, outputFilename);
Notes on @import
Internet Explorer only allows for 32 @import’s in each file. Also, it supposedly only allows for 3 or 4 levels of nested inheritance. This applies at least to versions 6 and 7. Luckily, thanks to the merging process, this should only be problem while developing.
TODO
- Add support for absolute paths to CSS files. This though requires the merger to know the web site’s root, which is doesn’t need currently.
- Make the command line app more intelligent.