csstools/precss

Is it dead?

Opened this issue ยท 11 comments

Last update 2 year ago... Doesn't work with PostCSS v8 correctly.

Is there any other way to compile scss in PostCSS?

When I start to move project to to postcss it become with dead plugins. Nice.

@jonathantneal, is this project abandoned?

When I start to move project to to postcss it become with dead plugins. Nice.

i have the same

This plugin is no longer recommended by PostCSS as it appears to be no longer maintained.

There is this 3rd-party pull request #142 to update PreCSS to the latest version of PostCSS. Not approved or merged yet.

If this pull request isn't merged and PreCSS definitively dies, recreating the functionality of it is pretty easy. PreCSS is no more than 6 PostCSS plugins bundled together with no extra functionality.

Check PreCSS's index.js:

// tooling
import postcss from 'postcss';
import postcssAdvancedVariables from 'postcss-advanced-variables';
import postcssAtroot from 'postcss-atroot';
import postcssExtendRule from 'postcss-extend-rule';
import postcssNested from 'postcss-nested';
import postcssPresetEnv from 'postcss-preset-env';
import postcssPropertyLookup from 'postcss-property-lookup';

// plugin chain
const plugins = [
	postcssExtendRule,
	postcssAdvancedVariables,
	postcssPresetEnv,
	postcssAtroot,
	postcssPropertyLookup,
	postcssNested
];

// plugin
export default postcss.plugin('precss', rawopts => {
	// initialize options, defaulting preset-env to stage 0 features
	const opts = Object.assign({ stage: 0 }, rawopts);

	// initialize all plugins
	const initializedPlugins = plugins.map(
		plugin => plugin(opts)
	);

	// process css with all plugins
	return (root, result) => initializedPlugins.reduce(
		(promise, plugin) => promise.then(
			() => plugin(result.root, result)
		),
		Promise.resolve()
	);
});

Adding these plugins to your own PostCSS configuration without PreCSS is pretty easy:

// In some webpack.config.js or gulpfile.js:

const postcss = require('postcss');
const postcssAdvancedVariables = require('postcss-advanced-variables');
const postcssAtroot = require('postcss-atroot');
const postcssExtendRule = require('postcss-extend-rule');
const postcssNested = require('postcss-nested');
const postcssPresetEnv = require('postcss-preset-env');
const postcssPropertyLookup = require('postcss-property-lookup');

postcss([
	postcssAdvancedVariables(),
	postcssAtroot(),
	postcssExtendRule(),
	postcssNested(),
	postcssPresetEnv(),
	postcssPropertyLookup(),
]));

The answer to this question is no, it's not dead. Maintenance on these projects was a bit halted in general for over 2 years. There are many things to be doing and we're doing our best.

Thanks for your patience and your help with PRs ๐Ÿ˜„

Estaba tomando caรฑas (โ–ถ๏ธ)

What about now? is it dead?

This project is dead for sure. Thank you to @AntonioRedondo for a viable replacement.

Are there other options?

Oh, precss

https://www.npmjs.com/package/precsss

fork from precss, insted it.