22.4.2 Specifying CSS options in a Mif2Go configuration file
To specify CSS options in a Mif2Go configuration file:
; UseCSS = Yes (default) or No
; WriteClassAttributes = Yes (default)
; or No (when ClassIsTag=Yes or when not using CSS)
; WriteCssStylesheet = Once (default), Always, or Never
; WriteCssLink = Yes (default) or No
; CssBrowserDetect= Macro reference to JavaScript code that determines
; browser type and writes link from HTML to appropriate CSS file
;CssBrowserDetect=<$BrowserCSS>
; CssFileName = name of style sheet to reference (file name, no path)
Use these options to do the following:
See also §Table 22-2 CSS-dependent default values of options.
Note: If you have been using [HtmlOptions]Stylesheet to specify CSS file options, see §22.4.5 Understanding effects of the older Stylesheet setting. The Stylesheet setting is deprecated in favor of the [CSS] settings listed in this section.
To direct Mif2Go to use CSS for your output:
; UseCSS = Yes (default) or No
When UseCSS=Yes, by default Mif2Go does the following:
• includes class attributes in paragraph tags
• creates the CSS file designated by CssFileName, if this file is not already present
• includes a link from the <head> element of each output file to the CSS file designated by CssFileName.
When UseCSS=No, paragraph tags do not include class attributes, no CSS file is referenced in the output, and the remaining [CSS] options are ignored.
See also §22.5 Understanding how CSS affects other options.
WriteClassAttributes values have the following effects:
Mif2Go includes CSS class attributes in the paragraph tags in your output; see §22.3 Understanding how Mif2Go generates CSS. |
|
Class attributes are not included in paragraph tags. Use this setting for XML output when [CSS]ClassIsTag=Yes, the default for XML; see §14.4.2 Deriving XML tags from format and class names. |
CssFileName designates the CSS file Mif2Go optionally creates and references. The default is local.css, located in the project directory. You can specify a different name and location for this file; see §22.4.3 Designating and locating a CSS file.
WriteCssStylesheet values have the following effects:
Mif2Go creates a new CSS file based on your FrameMaker formats, but only if no CSS file of the name designated by CssFileName is already present in the project directory. This is the default Mif2Go puts in place at set-up. Specify Once to get a starting CSS file that you can tweak manually. See §22.4.4 Directing Mif2Go to generate a CSS file. |
|
Mif2Go creates a new CSS file based on your FrameMaker formats, overwriting in the project directory any existing CSS file of the name designated by CssFileName. Specify Always if you do not need to tweak the CSS file, or if you can make any needed changes in macros, either in the configuration file or in a macro library. See §22.4.4 Directing Mif2Go to generate a CSS file. You can specify additional settings to govern what Mif2Go includes in a CSS file; see §22.8.4 Overriding styles in Mif2Go-generated CSS files. |
|
Mif2Go does not create a new CSS file, nor overwrite an existing file. When UseCSS=Yes, Mif2Go assumes you wish to use an existing CSS file: either the file designated by CssFileName, or a file to be selected at run time, depending on the values of WriteCssLink and CssBrowserDetect. Specify Never if you want to use an existing CSS file. See §22.4.3 Designating and locating a CSS file. |
WriteCssLink values have the following effects:
If CssBrowserDetect is not present, Mif2Go includes in the <head> element a simple link to the CSS file designated by CssFileName, in the relative directory designated by CssPath. The link is one of the following types: <link rel="stylesheet" href="local.css" type="text/css"> <?xml:stylesheet href="local.css" type="text/css" charset="UTF-8"?> If CssBrowserDetect is present, instead of the simple link Mif2Go includes the macro assigned to CssBrowserDetect in the <head> element. See §22.6.1 Selecting a CSS file at run time. |
|
Mif2Go does not create a link to a CSS file. Use this setting when you are not using CSS, or when you provide your own macro in [Inserts]Head to select a CSS file dynamically, independently of CssBrowserDetect. See §22.6.1 Selecting a CSS file at run time. |
When a macro is assigned to CssBrowserDetect, if WriteCssLink=Yes, the macro is included in the <head> element. If WriteCssLink=No, the macro is ignored. See §22.6.1 Selecting a CSS file at run time.
> 22 Setting up CSS for HTML > 22.4 Specifying CSS file and link options > 22.4.2 Specifying CSS options in a Mif2Go configuration file