postcss-content-width-unit

1.0.0-5 • Public • Published

PostCSS Content Width Unit Build Status Coverage Status

PostCSS plugin which adds limit to vw unit.

.foo {
  padding: 30rpx;
}
/* assuming contentMaxWidth = '1280px' */
.foo {
  padding: 2.3437vw;
}
 
@media screen and (min-width: 1280px) {
  .foo {
    padding: 30px;
  }
}

Usage

var contentWidthUnit = require('postcss-content-width-unit');
 
postcss([
  contentWidthUnit({contentMaxWidth: '1280px'})
]);

Options

contentMaxWidth: string, required

The global max-width value. Can be a variable name.

unit: string, optional, default: rpx

Content width unit which would be converted to regular CSS units.


See PostCSS docs for examples for your environment.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.0-50latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.0-50
1.0.0-40
1.0.0-30
1.0.0-20
1.0.0-10
1.0.0-00

Package Sidebar

Install

npm i postcss-content-width-unit

Weekly Downloads

0

Version

1.0.0-5

License

MIT

Last publish

Collaborators

  • kinday