-
Type:
Task
-
Status: Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 0.4.0
-
Labels:None
Specification of this task is incomplete
Motivation
Currently, SmartSprites uses a very simple line-based algorithm for parsing CSS. This was enough for the initial versions, but blocks implementation of more advanced and user-friendly features, such as breaking SmartSprites directives into multiple lines, removing original background-* properties.
Implementation
The initial implementation idea is to use some of the available ANTLR CSS grammars and extend it to support SmartSprites directives. Ideally, SmartSprites would parse the whole CSS file and copy the CSS rules that don't have SmartSprites directives unchanged to the output.
Refactorings
Implementing this task is a good opportunity to refactor a few things in the code:
- Drop passing various data structures as method parameters in favour of a context object that holds all available data structures.
- Think about refactoring sprite building tests to further reduce duplication and include testing through API calls, command line calls and Ant task calls. Ideally, all the expected results should be kept in one place and just verified three times for different calling mode.
Discussion
One important risk related to parser-based processing is that if the parser does not support some of the syntax used in the CSS file (@import, IE5 hacks), the whole processing may fail (with a parse error).
- is depended on by
-
SMARTSPRITES-23 Support of !important in background-image attribute
-
- Open
-
-
SMARTSPRITES-1 Intelligently handle original background-position and background-repeat CSS properties
-
- Open
-
-
SMARTSPRITES-13 Removing overriding and overridden CSS rules
-
- Open
-
-
SMARTSPRITES-3 Line breaking support for SmartSprites directives
-
- Open
-
-
SMARTSPRITES-51 Output one common background-image rule for each sprite image
-
- Open
-
-
SMARTSPRITES-58 Minimize the output css by concatenating all the styles under same sprite
-
- Open
-
-
SMARTSPRITES-22 Add support for shorthand background property
-
- Open
-