Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

postcss configurability #8

Description

@ctalkington

i've been going back and forth with a way to use grunt configs to fine tune the options of each postcss processor as the way it works now it can only be configured via functions and if i were to say want to change the rootValue for pxtorem (or disable for specific project), I have to do the following in my gruntfile.

function setPostCSSProcessors() {
    var parr = [];
    var plugins = grunt.config('postcss.options.plugins') || {};

    Object.keys(plugins).forEach(function(plugin) {
      if (plugins[plugin]) {
        var pluginFunc = require(plugin) || false;

        if (pluginFunc) {
          parr.push(pluginFunc(plugins[plugin] || {}));
        }
      }
    });

    grunt.config.set('postcss.options.processors', parr);
  };

  setPostCSSProcessors()

it would be possible to support something globally if load-project-config allowed passing options to load-grunt-config as theres postProcess option which would allow inherit and override as we get with other tasks but convert it to a processors array JIT

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions