A
A
ArtyV2012-05-05 09:52:50
css
ArtyV, 2012-05-05 09:52:50

How to deal with the CSS preprocessor in a large project?

CSS preprocessor users, how do you live with projects that have at least 50+ style files that are collected not in one file, but modularly with different levels (i.e. the page can have global CSS, section CSS and subsection CSS) ?

The question is more about dependencies and the use of mixins/variables.

A simple example:
We have a global mixin for rounded corners.
There are a bunch of style files where you need to use it. Some files end up as CSS for one module, some for another. At the same time, the mixin is located in a file that, with a simple scheme, would be collected in a global styles file.
How to manage such dependencies in this case? Explicitly include the mixin file in the module files? But what if this mixin can also be rendered in its purest form, like CSS, for example .ie-layout { zoom: 1; }.

The specific preprocessor is not particularly important, it's just interesting how this generally happens in different preprocessors.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
almazmusic, 2012-05-05
@almazmusic

Tell me, honestly, what is the profit for the project from all this preprocessor? What is the benefit for developers? How do users feel about editors/ideas that don't support preprocessor syntax? Does the project use the NSA principle? How do mixins help this (specifically NSA, not rounded corners)?

K
kuzemchik, 2012-05-05
@kuzemchik

xml file listing modules with source and lib inside. Source is minified to the module file. lib separately. On dev it is given as is, on prod the module file + lib. The same xml is the manager for minifires.
Can be finished with a file up to several levels.

A
Andrey Sitnik, 2012-05-06
@Iskin

We use Sass, Compass (ready-made mixins for CSS3, autosprites, image manipulation, etc.) and Assets Pipeline (compilation, assembly into one file, compression, dependency accounting) - a very convenient bundle. The only problem is that it integrates well (more precisely, it is built “out of the box”) only into the Ruby on Rails project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question