Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CSS Nano Parameters #104

Closed
cjkoepke opened this issue Jun 2, 2018 · 3 comments
Closed

Allow CSS Nano Parameters #104

cjkoepke opened this issue Jun 2, 2018 · 3 comments

Comments

@cjkoepke
Copy link

cjkoepke commented Jun 2, 2018

Expected Behavior

It would be nice to be able to pass options to the CSS Nano plugin, via something like this:

css: {
	basefontsize: 18,
	remreplace: false,
	remmediaquery: false,
	cssnano: {
		'z-index': false,
	},
}

Current Behavior

You can't pass any options.

Possible Solution

Pass to the config option (if present) to the cssnano() block in the build:css file.

Context

If I need to keep z-index levels for plugin compatibility (WooCommerce sets certain things to over 1000), I have to rebuild a custom build pipeline. This is more work than necessary, so at the moment I'm printing z-index overwrites into the header as inline styles.

@cjkoepke
Copy link
Author

cjkoepke commented Jun 2, 2018

Also, happy to submit a PR for this.

craigsimps added a commit that referenced this issue Jun 5, 2018
As outlined in #104, CSSNano alters z-index attributes in the
stylesheet which causes issues when you're trying to override rules from
plugins or other CSS files.

See #104
craigsimps added a commit that referenced this issue Jun 5, 2018
* Update `.csscomb.json` to more WPCS friendly ruleset.

* Allow passing options to `cssnano` package.

As outlined in #104, CSSNano alters z-index attributes in the
stylesheet which causes issues when you're trying to override rules from
plugins or other CSS files.

See #104

* Remove style guide task.

* Fix `gulp bump` task.

As outlined in #87, there is an issue with the `gulp bump` task not
respecting parameters passed to it. I've gone with your suggested code,
@timothyjensen. As part of the updates I've found I can no longer pass
`--minor` as it's a Node Flag. That being the case, I've shortened the
arguments to the following:

`gulp bump` - a patch release, ie 1.0.0 to 1.0.2
`gulp bump --mi` - a minor release, ie 1.0.0 to 1.1.0
`gulp bump --ma` - a major release, ie 1.0.0 to 2.0.0

Fixes #87

* Update version number ahead of merge.
@craigsimps
Copy link
Owner

craigsimps commented Jun 5, 2018

This feature has been added in release 2.3.1

Example config available at:
https://github.com/craigsimps/gulp-wp-toolkit/blob/master/example/Gulpfile.js#L84-L89

@cjkoepke
Copy link
Author

cjkoepke commented Jun 5, 2018

Thanks for the quick inclusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants