Using Custom CSS Style Sheets

You can include custom CSS styles sheets in your EPUB just as you can for HTML output generally.

The EPUB transformation type uses the same Ant parameters for CSS styles sheets as for the normal HTML transformation type. The difference is that you must copy the CSS files to the output since they need to be part of the EPUB package. Thus the args.copycss parameter is implicitly set to "yes" if you specify the args.css parameter.

You may specify the directory within the EPUB package to contain the CSS files using the regular XHTML parameter args.csspath. The value must be a path relative to the root of the EPUB container, e.g. "css".

The args.css parameter can be an absolute path to the CSS file or it can be a path relative to the value of the args.cssroot parameter.

For example, if you have a custom CSS file mystyle.css in the directory c:\projects\mydoc\css and you want to use that CSS file in your EPUB you would specify the Ant parameter args.css with the value "c:\projects\mydoc\css\mystyle.css".

If you have a common CSS source directory and you use different CSS files for different publications, you can specify both args.cssroot and args.css like so:
  • args.cssroot as "c:\projects\mydoc\css"
  • args.css as "mystyle.css"

The built-in CSS style sheets provided with the DITA Open Toolkit are always included in the EPUB in the CSS output directory by default. You can omit the built-in CSS files by specifying "false" for the epub.copy.system.css parameter, which is true by default.