Socket
Socket
Sign inDemoInstall

postcss-amp-custom

Package Overview
Dependencies
4
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-amp-custom

PostCSS plugin to optimize CSS source for AMP HTML.


Version published
Maintainers
1
Weekly downloads
565
increased by30.79%

Weekly downloads

Readme

Source

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.

Keywords

FAQs

Last updated on 30 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc