Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

postcss-amp-custom

1.3.1 • Public • Published

postcss-amp-custom

License: MIT npm version Build Status

PostCSS plugin to optimize CSS source for AMP HTML.

amp-custom is the core library.

Install

npm install --save-dev postcss-amp-custom

Use

// postcss.config.js
module.exports = () => ({
    plugins: [
        require('postcss-amp-custom')({
            enableByteLimit: true
        })
    ]
});
/* ./src/test.css */
 
@charset "UTF-8";
body {
  font-size: 16px;
}
@page {
  margin: 15mm;
}
@page hoge {
  size: portrait;
  margin: 15mm;
}
a {
  color: #39c !important;
  text-decoration: none;
}
@viewport {
  min-width: 640px;
  max-width: 800px;
}
@supports not (display: flex{
  .flexbox {
    overflow: hidden;
  }
  .flexbox div {
    float: left;
  }
}
 
 
/* ./dist/test.css */
 
body{font-size:16px}a{color:#39c;text-decoration:none}

Options

  • enableByteLimit Boolean - If the CSS source exceeds 50 KB, it issues an error.(Default: false)

Plugins

License

MIT License.

Install

npm i postcss-amp-custom

DownloadsWeekly Downloads

9

Version

1.3.1

License

MIT

Unpacked Size

6.2 kB

Total Files

11

Last publish

Collaborators

  • avatar