This repository was archived by the owner on Jun 19, 2026. It is now read-only.
forked from braxtonCoats/exporter-css-scss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
101 lines (96 loc) · 4.93 KB
/
Copy pathconfig.ts
File metadata and controls
101 lines (96 loc) · 4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { StringCase, ColorFormat } from "@supernovaio/export-utils"
import { TokenType } from "@supernovaio/sdk-exporters"
/**
* Main configuration of the exporter - type interface. Default values for it can be set through `config.json` and users can override the behavior when creating the pipelines.
*/
export enum ThemeExportStyle {
ApplyDirectly = "applyDirectly",
SeparateFiles = "separateFiles",
MergedTheme = "mergedTheme",
}
export enum FileStructure {
SeparateByType = "separateByType",
SingleFile = "singleFile",
}
export enum TokenNameStructure {
PathAndName = "pathAndName",
NameOnly = "nameOnly",
CollectionPathAndName = "collectionPathAndName",
}
export enum OutputFormat {
CSS = "css",
SCSS = "scss",
Both = "both",
}
export type ExporterConfiguration = {
/** When enabled, a disclaimer showing the fact that the file was generated automatically and should not be changed manually will appear in all style styles */
showGeneratedFileDisclaimer: boolean
/** When enabled, a disclaimer showing the fact that the file was generated automatically and should not be changed manually will appear in all style styles */
disclaimer: string
/** When enabled, file with all css style files imported will be generated */
generateIndexFile: boolean
/** When enabled, empty style files will be generated. Otherwise empty are omitted */
generateEmptyFiles: boolean
/** When enabled, token description will be shown as code comments for every exported token */
showDescriptions: boolean
/** When enabled, values will use references to other tokens where applicable */
useReferences: boolean
/** Style of exported token names */
tokenNameStyle: StringCase
/** Format of the exported colors */
colorFormat: ColorFormat
/** Max number of decimals in colors */
colorPrecision: number
/** Number of spaces used to indent every css variables */
indent: number
/** When set, will prefix each token of a specific type with provided identifier. Put empty string if not necessary */
tokenPrefixes: Record<TokenType, string>
/** Name of each file that will be generated. Tokens are grouped by the type and will land in each of those files */
styleFileNames: Record<TokenType, string>
/** Name of the index file that will be generated */
indexFileName: string
/** All files will be written to this directory (relative to export root set by the exporter / pipeline configuration / VSCode extension) */
baseStyleFilePath: string
/** Index file will be written to this directory (relative to export root set by the exporter / pipeline configuration / VSCode extension) */
baseIndexFilePath: string
/** CSS selector where variables will be defined */
cssSelector: string
/** CSS selector pattern for themes, {theme} will be replaced with theme name */
themeSelector: string
/** Controls how themes are exported in the CSS files */
exportThemesAs: ThemeExportStyle
/** When enabled, themed files will only include tokens that have different values from the base theme */
exportOnlyThemedTokens: boolean
/** When enabled, base token values will be exported along with themes */
exportBaseValues: boolean
/** When enabled, converts pixel values to rem units */
forceRemUnit: boolean
/** Base pixel value for rem conversion (default: 16) */
remBase: number
/** When enabled, allows customization of style file names */
customizeStyleFileNames: boolean
/** When enabled, allows customization of token prefixes */
customizeTokenPrefixes: boolean
/** Global prefix for all token names. When set, all tokens will be prefixed with this value */
globalNamePrefix: string
/** Controls how token styles are organized in files */
fileStructure: FileStructure
/** Controls what parts are included in the token name */
tokenNameStructure: TokenNameStructure
/** When enabled, generated variable names will be saved back to tokens as custom properties */
writeNameToProperty: boolean
/** Name of the custom property where generated variable names will be saved */
propertyToWriteNameTo: string
/** If enabled, the resulting written properties will be encapsulated in var() syntax for easier copying */
propertyToWriteNameToIncludesVar: boolean
/** When enabled, references will include fallback values as raw token values to handle cases when referenced variables are not loaded */
useFallbackValues: boolean
/** Controls the output format for base (non-themed) token files */
outputFormat: OutputFormat
/** Controls the output format for theme-specific files. Defaults to CSS so theme overrides can be loaded at runtime without recompiling SCSS */
themeOutputFormat: OutputFormat
/** Comma-separated list of token set (collection) names to exclude from CSS output. Case-insensitive. Leave empty to include all. */
cssExcludeTokenSets: string
/** Comma-separated list of token set (collection) names to exclude from SCSS output. Case-insensitive. Leave empty to include all. */
scssExcludeTokenSets: string
}