Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
mincss
Commits
edae5198
Commit
edae5198
authored
Jul 24, 2014
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated README
parent
dcb1102c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
2 deletions
+66
-2
README.md
README.md
+66
-2
No files found.
README.md
View file @
edae5198
mincss is a CSS minifier that merges different groups of properties, for
different selectors.
mincss is an extendible CSS minifier written in OCaml. It contains a complete
parser for the CSS3 language, along with consistent type definitions and a
traversal utility function for use in transformation passes.
mincss is currently still in development, finished components are the parser,
stringification (along with whitespace compression), and color compression.
Rulset merging is partially documented below but currently unimplemented.
Features
========
-
Whitespace compression
-
Color compression
-
Creation of shorthand properties (e.g.
`font`
and
`background`
)
-
Ruleset merging (see below)
-
Command-line interface and web interface
Ruleset merging
---------------
Apart from simply writing the CSS in a shorter format (i.e.
whitespace/color/shorthand compression), mincss attempts to restructure rule
sets into a shorter variant. For example:
a { color: red }
p { color: red }
can be written much shorter as:
a, p { color: red }
Merging selectors is something that is done by the programmer in most cases,
but the example above may occur when multiple different CSS files are merged
into one, or when a large CSS file is structured in such a way that the
definitions of
`a`
and
`p`
are far apart. A special case is when the same
selector appears in different rulesets, which may happen when a framework
stylesheet is merged with a page-specific stylesheet:
a {
color: blue;
font-weight: bold;
}
...
a {
color: red;
}
This is merged into:
a {
color: blue;
font-weight: bold;
color: red;
}
Because the
`color`
property is now overwritten in the same ruleset, the early
definition is removed:
a {
font-weight: bold;
color: red;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment