Minification (or compression) of a CSS document is the practice of
removing unnecessary code without affecting the functionality of the stylesheet.
To minify a CSS, invoke the contextual menu anywhere in the edited document and choose the
Minify CSS... action.
Oxygen XML Editor opens a dialog that
allows you to:
- set the location of the resulting CSS
- place each style rule on a new line
After pressing
OK,
Oxygen XML Editor performs the following actions:
- all spaces are normalized (all leading and trailing spaces are removed, while sequences
of white spaces are replaced with single space characters)
- all comments are removed
Note: The CSS minifier relies heavily upon the W3C CSS specification. If the content of
the CSS file you are trying to minify does not conform with the specifications, an error
dialog will pop-up, listing all errors encountered during the processing.
The resulting CSS stylesheet gains a lot in terms of execution performance, but loses in
terms of readability. The source CSS document is left unaffected.
Note: To restore the
readability of a minified CSS, invoke the Format and Indent action
from the menu, the Source submenu from the contextual menu,
or Source toolbar. However, this action will not recover any of the
deleted comments.