1.4.0 • Published 3 years ago

postcss-amp-custom v1.4.0

Weekly downloads
256
License
MIT
Repository
github
Last release
3 years ago

postcss-amp-custom

License: MIT npm version Build Status

PostCSS plugin to optimize CSS source for AMP HTML. Removes styles that are prohibited by AMP HTML.

Supports PostCSS v7 and v8.

amp-custom is the core library. However, amp-custom will be deprecated in the future, and postcss-amp-custom will be mainly developed.

Install

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

Use

// postcss.config.js
const postcssAmpCustom = require('postcss-amp-custom')

module.exports = () => ({
  plugins: [
    postcssAmpCustom({
      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 75KB, it issues an error.(Default: false)

License

MIT License.

1.4.0

3 years ago

1.4.0-alpha.5

3 years ago

1.4.0-alpha.6

3 years ago

1.4.0-alpha.4

3 years ago

1.4.0-alpha.3

3 years ago

1.4.0-alpha.1

3 years ago

1.4.0-alpha.2

3 years ago

1.4.0-alpha.0

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.6

5 years ago

1.2.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

6 years ago

0.9.0

6 years ago