1 |
-- Factor a CSS stylesheet |
-- |
2 |
|
-- This file is part of FactorCSS |
3 |
|
-- Licensed under the MIT License, |
4 |
|
-- http://www.opensource.org/licenses/mit-license |
5 |
|
-- Copyright 2004 James Bursa <james@semichrome.net> |
6 |
|
-- |
7 |
|
|
8 |
|
-- Factor a CSS stylesheet. |
9 |
|
-- |
10 |
|
-- This tool takes a CSS stylesheet on input and produces an almost equivalent |
11 |
|
-- stylesheet on output, but with rulesets split, combined, and reordered to |
12 |
|
-- "factor out" common declarations. This helps reveal shared components. The |
13 |
|
-- resulting stylesheet may also be smaller. |
14 |
|
-- |
15 |
|
-- The only known case where the output is not equivalent to the input is when |
16 |
|
-- the stylesheet depends on the order of rules (see CSS 2.1 6.4.1). |
17 |
|
|
18 |
import List |
import List |
19 |
import Tokeniser |
import Tokeniser |