docusaurus/packages/docusaurus-cssnano-preset/src/index.ts
dpang314 1f0440074a
fix(cssnano-preset): disable z-index minification (#7593)
* fix(cssnano-preset): disable z-index minification

* add z-index tests link to pages tests

* revert change to docs
2022-06-15 12:13:25 +02:00

29 lines
848 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import advancedBasePreset from 'cssnano-preset-advanced';
import postCssSortMediaQueries from 'postcss-sort-media-queries';
import postCssRemoveOverriddenCustomProperties from './remove-overridden-custom-properties';
const preset: typeof advancedBasePreset = function preset(opts) {
const advancedPreset = advancedBasePreset({
autoprefixer: {add: false},
discardComments: {removeAll: true},
/* cSpell:ignore zindex */
zindex: false,
...opts,
});
advancedPreset.plugins.unshift(
[postCssSortMediaQueries, undefined],
[postCssRemoveOverriddenCustomProperties, undefined],
);
return advancedPreset;
};
export = preset;