File Headers
File headers is a hook that provides a way to configure the header of output files.
File header structure
A file header is an object with two props:
name
: the name of the file headerfileHeader
: a callback function that receives the default message array of strings, usually set by the format, and returns an array of strings (message lines) or a Promise with an array of strings.
The array of strings will be concatenated using newline separator.
Using file headers
First you will need to tell Style Dictionary about your file header. You can do this in two ways:
- Using the
.registerFileHeader
method - Inline in the configuration
hooks.fileHeaders
property
.registerFileHeader
Inline
Applying it in config
File-specific:
or platform-specific: