I am trying to process custom properties defined in one CSS file and used in several others by means of the postcss-custom-properties plugin.
To do this I have another task that extracts all properties defined in any CSS files and stores them as an object on grunt.config. I then want to use this as the value for a setting in the plugin:
However I keep getting ”variable [variable name] is undefined and used without a fallback”. I tried writing a simple test plugin and grunt.config('settings.custom_properties') is undefined inside the plugin (because it doesn’t know about the grunt object I suppose). If I instead try to use a grunt template, like this:
variables: '<%= settings.custom_properties %>'
I get that exact text, i.e. the template does not get expanded.
Obviously I’m doing something wrong and would appreciate any help or pointers.
I am trying to process custom properties defined in one CSS file and used in several others by means of the postcss-custom-properties plugin.
To do this I have another task that extracts all properties defined in any CSS files and stores them as an object on grunt.config. I then want to use this as the value for a setting in the plugin:
However I keep getting ”variable [variable name] is undefined and used without a fallback”. I tried writing a simple test plugin and grunt.config('settings.custom_properties') is undefined inside the plugin (because it doesn’t know about the grunt object I suppose). If I instead try to use a grunt template, like this:
variables: '<%= settings.custom_properties %>'
I get that exact text, i.e. the template does not get expanded.
Obviously I’m doing something wrong and would appreciate any help or pointers.