@postcss-plugins/console
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.5 • Public • Published

    @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

    Install

    npm i @postcss-plugins/console

    DownloadsWeekly Downloads

    36

    Version

    0.2.5

    License

    MIT

    Unpacked Size

    15.2 kB

    Total Files

    19

    Last publish

    Collaborators

    • ezavile