https://github.com/kimulaco/gulp-amp-custom
Gulp plugin to optimize CSS source for AMP HTML.
https://github.com/kimulaco/gulp-amp-custom
amp amp-html gulp-plugins
Last synced: 9 months ago
JSON representation
Gulp plugin to optimize CSS source for AMP HTML.
- Host: GitHub
- URL: https://github.com/kimulaco/gulp-amp-custom
- Owner: kimulaco
- License: mit
- Created: 2017-12-15T13:44:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T10:25:50.000Z (over 3 years ago)
- Last Synced: 2025-08-20T14:44:02.009Z (10 months ago)
- Topics: amp, amp-html, gulp-plugins
- Language: JavaScript
- Size: 1.25 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-amp-custom
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/gulp-amp-custom)
[](https://github.com/kimulaco/gulp-amp-custom/actions)
Gulp plugin to optimize CSS source for AMP HTML.
**Maintenance of this plugin will be discontinued. Please use [postcss-amp-custom](https://github.com/kimulaco/postcss-amp-custom).**
## Install
```shell
npm install --save-dev gulp-amp-custom
```
## Use
```js
const gulp = require('gulp');
const ampCustom = require('gulp-amp-custom');
gulp.task('test', () => {
return gulp.src('./src/test.css')
.pipe(ampCustom({
enableByteLimit: true
}))
.pipe(gulp.dest('./dist/'));
});
```
```css
/* ./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;
}
}
```
```css
/* ./dist/test.css */
body{font-size:16px}a{color:#39c;text-decoration:none}
```
## Options
### enableByteLimit
Type: `Boolean`
If the CSS source exceeds 75 KB, it issues an error.(Default: `false`)
## License
[MIT License](LICENSE).