{"id":14968183,"url":"https://github.com/madeleineostoja/poststylus","last_synced_at":"2026-01-11T22:04:08.603Z","repository":{"id":44153842,"uuid":"37540945","full_name":"madeleineostoja/poststylus","owner":"madeleineostoja","description":"PostCSS adapter for Stylus","archived":false,"fork":false,"pushed_at":"2022-11-04T03:23:17.000Z","size":107,"stargazers_count":285,"open_issues_count":12,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-10-30T04:09:14.957Z","etag":null,"topics":["css","postcss","poststylus","preprocessor","stylus"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madeleineostoja.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-16T16:06:06.000Z","updated_at":"2024-11-13T07:31:02.000Z","dependencies_parsed_at":"2022-09-02T06:43:56.993Z","dependency_job_id":null,"html_url":"https://github.com/madeleineostoja/poststylus","commit_stats":null,"previous_names":["seaneking/poststylus"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/madeleineostoja/poststylus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeleineostoja%2Fpoststylus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeleineostoja%2Fpoststylus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeleineostoja%2Fpoststylus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeleineostoja%2Fpoststylus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madeleineostoja","download_url":"https://codeload.github.com/madeleineostoja/poststylus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeleineostoja%2Fpoststylus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","postcss","poststylus","preprocessor","stylus"],"created_at":"2024-09-24T13:39:29.546Z","updated_at":"2026-01-11T22:04:08.584Z","avatar_url":"https://github.com/madeleineostoja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostStylus\n[![NPM version][npm-image]][npm-url] [![NPM downloads][downloads-badge]][npm-url] [![Build Status][travis-image]][travis-url]\n\nPostStylus is a [PostCSS][postcss] adapter for Stylus. It allows you to use any PostCSS plugin as a transparent Stylus plugin, and do custom post-processing of Stylus output.\n\nIt loads PostCSS processors into Stylus just before the output CSS is compiled to file.\n\nInspired by [autoprefixer-stylus][autoprefixer-stylus]\n\n### Contents\n\n- [Install](#install)\n- [Usage](#usage)\n  - [Gulp](#gulp)\n  - [Grunt](#grunt)\n  - [Webpack](#webpack)\n  - [CLI](#cli)\n- [Passing Arguments to Plugins](#passing-arguments-to-plugins)\n- [Custom Processing](#custom-processing)\n- [Warning Handler](#warning-handler)\n- [Asynchronous Processing](#asynchronous-processing)\n\n## Install\n\n```sh\n$ npm install --save-dev poststylus\n```\n\n## Usage\n\nUse `poststylus` as a regular stylus plugin and pass it an array of PostCSS plugins you have installed, either as strings or functions.\n\n```js\nstylus(css).use(poststylus([\n  'autoprefixer',\n  'rucksack-css'\n]))\n```\n\n#### Gulp\n\n```js\nvar gulp = require('gulp'),\n    stylus = require('gulp-stylus'),\n    poststylus = require('poststylus'),\n    autoprefixer = require('autoprefixer'),\n    rucksack = require('rucksack-css');\n\ngulp.task('stylus', function () {\n  gulp.src('style.styl')\n    .pipe(stylus({\n      use: [\n        poststylus([ autoprefixer, rucksack ])\n      ]\n    }))\n    .pipe(gulp.dest('.'))\n});\n\ngulp.task('default', ['stylus']);\n```\n\n#### Grunt\n\n`grunt-contrib-stylus` doesn't support passing arguments to plugins, so you have to wrap PostStylus in a function and return it\n\n``` js\nvar postcss = function(){\n  return require('poststylus')(['autoprefixer', 'rucksack-css']);\n}\n\nmodule.exports = function(grunt) {\n\n  grunt.initConfig({\n\n    stylus: {\n      compile: {\n        options: {\n          use: [postcss]\n        },\n        files: {\n          'style.css': 'style.styl'\n        }\n      }\n    }\n\n  });\n\n  grunt.loadNpmTasks('grunt-contrib-stylus');\n\n};\n```\n\n#### Webpack\n\nUse [stylus-loader][stylus-loader] with PostStylus as a plugin in your webpack.conf.js\n\n```\nvar poststylus = require('poststylus'),\n    webpack = require('webpack');\n\nmodule: {\n  loaders: [\n    { test: /\\.styl$/, loader: 'style-loader!css-loader!stylus-loader' }\n  ]\n},\nstylus: {\n  use: [\n    poststylus([ 'autoprefixer', 'rucksack-css' ])\n  ]\n}\n```\n\nIf you are using webpack 2, use `LoaderOptionsPlugin` to set options\n\n```\nmodule: {...},\nplugins: [\n  new webpack.LoaderOptionsPlugin({\n    options: {\n      stylus: {\n        use: [poststylus([ 'autoprefixer', 'rucksack-css' ])]\n      }\n    }\n  })\n]\n```\n\n#### CLI\n\nTo use PostStylus on the Stylus CLI, pass `poststylus` to `--use`, and PostCSS plugins to `--with`:\n\n```sh\n$ stylus --use ./node_modules/poststylus --with \"['autoprefixer']\" --out test.css \u003c test.styl\n```\n\n## Passing Arguments to Plugins\n\nIf you need to pass arguments to a PostCSS plugin `require()` it and pass that function to PostStylus\n\n```js\nvar autoprefixer = require('autoprefixer');\n\nstylus(css).use([\n  poststylus([\n    autoprefixer({ browsers: ['ie 8'] })\n  ])\n])\n```\n\nTo pass arguments to PostCSS plugins on the CLI, you'll need to prefix `require()` with `$PWD`, since the `stylus` executable runs globally, while your plugins are (probably) installed locally:\n\n```sh\nstylus --use ./node_modules/poststylus --with \"[require('${PWD}/node_modules/autoprefixer')({ browsers: ['ie 8'] })]\" --out test.css \u003c test.styl\n```\n\n## Custom Processing\n\nDo custom post-processing of Stylus output by declaring an on-the-fly PostCSS plugin\n\n```js\nvar myPostcss = postcss.plugin('custom', function() {\n  return function (css) {\n    // PostCSS processing here\n  };\n});\n\n// Pipe it into poststylus\nstylus(css).use(poststylus([myPostcss()]));\n```\n\nRefer to the [PostCSS Docs][postcss-link] for more on writing plugins.\n\n## Warning Handler\n\nBy default, if any of your PostCSS plugins raise a warning it will be displayed using `console.error`. You can override this behaviour by passing a function as the second argument to PostStylus.\n\n```js\nstylus(css).use(poststylus([\n    'autoprefixer',\n    'rucksack-css'\n], function(message) {\n    console.info(message);\n}));\n```\n\n## Asynchronous Processing\n\nUnfortunately the Stylus `end` event that PostStylus uses to pass back post-processed CSS doesn't accept a callback, so until [this](https://github.com/stylus/stylus/issues/1698) bug is patched upstream PostStylus cannot work with asynchronous PostCSS processing.\n\n***\n\nMIT © [Sean King](https://twitter.com/seaneking)\n\n[npm-image]: https://badge.fury.io/js/poststylus.svg\n[npm-url]: https://npmjs.org/package/poststylus\n[downloads-badge]: https://img.shields.io/npm/dm/postcss-responsive-type.svg\n[travis-image]: https://travis-ci.org/seaneking/poststylus.svg?branch=master\n[travis-url]: https://travis-ci.org/seaneking/poststylus\n[postcss]: https://github.com/postcss/postcss\n[autoprefixer-stylus]: https://github.com/jenius/autoprefixer-stylus\n[stylus-loader]: https://github.com/shama/stylus-loader\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeleineostoja%2Fpoststylus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadeleineostoja%2Fpoststylus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeleineostoja%2Fpoststylus/lists"}