Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@postcss-plugins/console

ezavile28MIT0.2.5TypeScript support: included

A PostCSS plugin to output messages to the terminal.

@postcss, @postcss-plugins, postcss, postcss-plugins, console, debug, log, terminal

readme

@postcss-plugins/console

npm

A PostCSS plugin to output messages to the terminal.

Installation

yarn add @postcss-plugins/console

What is this? For example, you have the following CSS file (I'm using postcss-each, @postcss-plugins/text-transform and postcss-cssnext):

backgrounds.css

.u {
  @console.warn Here comes the postcss-console plugin;
  @each $color in green, yellow, red {
    @console.assert '$color' == 'green';
    @text-transform $color, upperFirst, $transformed {
      @console.log the text was transformed from $color to $transformed;
      &-bg$(transformed) {
        background-color: $color;
      }
    }
  }
  @console.error This is an error message;
}

And the plugin will give you:

console

Usage

Put this plugin after all plugins.

postcss([require('other-plugin'), require('@postcss-plugins/console')]);

Methods

@console.log This is an informative message
@console.warn This is a warn message
@console.error This is an error message
@console.assert Boolean expression;

Testing

yarn test

Contributing

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.

MIT License

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.2.5 (2021-03-09)

Note: Version bump only for package @postcss-plugins/console

0.2.4 (2021-02-25)

Bug Fixes

  • console: point to declaration file (9ad240f)

0.2.3 (2021-02-09)

Note: Version bump only for package @postcss-plugins/console

0.2.2 (2020-10-01)

Note: Version bump only for package @postcss-plugins/console

0.2.1 (2020-10-01)

Note: Version bump only for package @postcss-plugins/console

0.2.0 (2020-09-27)

Bug Fixes

  • console: use faster API (22c6fa4)

Features

  • console: use named export (66fef59)

0.1.0 (2020-09-19)

Features

  • console: add plugin code (29cc11c)