CSS: not based on the formats in a DITA document!

The DITA2Go manual says at Section 30.3 that "DITA2Go generates CSS based on the formats in your document." This needs to be revised, because of course a DITA XML document contains no formatting information.

By default, the file ohmain.css gets generated every time I run a project (for OmniHelp output), so modifying it in the project output folder is not effective. To prevent the file from being overwritten, I must alter the value for WriteCssStyleSheet in d2hmt_config.ini. Then at least I have the option of copying in my preferred CSS file manually after a project has been generated once.

To control the CSS generated by DITA2Go, I think I can use the approach described at Section 30.8.3, "Overriding styles in DITA2GO-generated CSS files" (I haven't tried it yet). But where does DITA2GO get the formatting information in the first place?

CSS creation

If you want to be a bit more precise, the CSS is based on the formats to which you map the DITA elements in your document. But surely, you understood this?

Yes, the default is to create a new CSS, but as you noticed, there is a setting you can use to retain the CSS as-is. That's what we usually advise people to do if they customize the CSS. Then if you have new formats (classes, in HTML) in your doc, we can't add them to the CSS; you have to do that yourself. Which is why the default is what it is.

We get the formatting information from the formats defined for your doc, via the [Templates]Formats file chain. We provide reasonable starting defaults so you get good-looking results out of the box, and you can change them to your taste in numerous ways, as explained in Chapter 7, "Configuring output formats".