سؤال

Our website has some very complicated styling and we want to ensure that the CSS does not become unmanageable.

In Production, our ideal appears to be the minimum number of external CSS files as possible (ideally 1?) available via a public CDN server and probably in a minimized version.

In Development, our ideal appears to be multiple CSS files; each CSS file would contain just those styles for a particular concept, such as Tabs or a DateTime picker (just making these up, but you get the idea). Having multiple files allows the Developers/Designers to quickly find the CSS classes of interest and we also face less file-contention issues as everyone is updating separate files.

I'm tempted to keep the individual files for Development's purpose but have an external App that concatenates/minifies the CSS files for Production. However, I'm sure this isn't the first site to be facing these issues so I'd be interested in hearing how others have solved this.

هل كانت مفيدة؟

المحلول

ASP.NET 4.5 supports bundling and minifcation. You can define your entire CSS folder to be bundled and minified into a single file.

http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx

When in debug (i.e. development) it will not be minified and for a prod release build you will get the minification

نصائح أخرى

I highly recommend Compass, an open-source authoring framework that supports Sass and provides, among many other things, the ability to have separate files for development that are concatenated (and minified!) for production using a build process.

http://compass-style.org/

Here's a brief blog entry on some of Compass's benefits.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top