You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: outputReferenceFallbacks for css/variables formatter (#1113)
- outputReferenceFallbacks options are passed through to the
createPropertyFormatter function, which was previously not the case
Signed-off-by: Tobias Kuppens Groot <tkuppensgroo@uos.de>
Co-authored-by: Joren Broekema <joren.broekema@gmail.com>
Copy file name to clipboardExpand all lines: lib/common/formatHelpers/formattedVariables.js
+3
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ const defaultFormatting = {
34
34
* @param {String} options.format - What type of variables to output. Options are: css, sass, less, and stylus
35
35
* @param {Dictionary} options.dictionary - The dictionary object that gets passed to the formatter method.
36
36
* @param {Boolean} [options.outputReferences] - Whether or not to output references
37
+
* @param {Boolean} [options.outputReferenceFallbacks] - Whether or not to output a faLLback value for output references
37
38
* @param {Formatting} [options.formatting] - Custom formatting properties that define parts of a declaration line in code. This will get passed to `formatHelpers.createPropertyFormatter` and used for the `lineSeparator` between lines of code.
38
39
* @param {Boolean} [options.themeable] [false] - Whether tokens should default to being themeable.
39
40
* @param {boolean} [options.usesDtcg] [false] - Whether DTCG token syntax should be uses.
@@ -56,6 +57,7 @@ export default function formattedVariables({
56
57
format,
57
58
dictionary,
58
59
outputReferences =false,
60
+
outputReferenceFallbacks,
59
61
formatting ={},
60
62
themeable =false,
61
63
usesDtcg =false,
@@ -85,6 +87,7 @@ export default function formattedVariables({
Copy file name to clipboardExpand all lines: lib/common/formats.js
+9-2
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ const formats = {
71
71
* @typedef {Object} cssVariablesOpts
72
72
* @property {Boolean} [cssVariablesOpts.showFileHeader=true] - Whether or not to include a comment that has the build date
73
73
* @property {Boolean} [cssVariablesOpts.outputReferences=false] - Whether or not to keep [references](/#/formats?id=references-in-output-files) (a -> b -> c) in the output.
74
+
* @property {Boolean} [cssVariablesOpts.outputReferenceFallbacks=false] - Whether or not to add a fallback value for the output reference.
74
75
* @property {string} [cssVariablesOpts.selector] - Override the root css selector
0 commit comments