This package has been deprecated

Author message:

please use @postcss-plugins/text-transform instead

postcss-text-transform
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

postcss-text-transform

Travis Codecov npm MIT License

A PostCSS plugin to transform the text.

Installation

npm install postcss-text-transform

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

backgrounds.css

.u {
  @each $color in greenyellowred {
    @text-transform $colorupperFirst, $colorTransformed {
      &-bg$(colorTransformed) {
        background-color: $color;
      }
    }
  }
}

And the plugin will give you:

.u-bgGreen {
  background-color: green
}
 
.u-bgYellow {
  background-color: yellow
}
 
.u-bgRed {
  background-color: red
}

Usage

JavaScript

postcss([
   require('postcss-text-transform')
]);

TypeScript

import * as postcssTextTransform from 'postcss-text-transform';
 
postcss([ postcssTextTransform() ]);
@text-transform $text, transformation, $textTransformed { ... }

Transformations

  • camelCase - Converts to camel case.
  • capitalize - Converts the first character of string to upper case and the remaining to lower case.
  • lowerCase - Converts string, as space separated words, to lower case.
  • lowerFirst - Converts the first character of string to lower case.
  • upperCase - Converts string, as space separated words, to upper case.
  • upperFirst - Converts the first character of string to upper case.

Testing

This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.

npm test

See PostCSS docs for examples for your environment.

Contributing

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests (npm test).

MIT License

Package Sidebar

Install

npm i postcss-text-transform

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • ezavile