postcss-ellipsis
Version:
A postcss plugin to add automatically add overflow: hidden and white-space: nowrap when text-overflow: ellipsis is declared
51 lines (38 loc) • 926 B
Markdown
A [PostCSS] plugin to add automatically add overflow: hidden and white-space: nowrap when text-overflow: ellipsis is declared
[]: https://github.com/postcss/postcss
[]: https://github.com/gulpjs/gulp
```js
npm install postcss-ellipsis
```
```css
div {
text-overflow: ellipsis
}
```
will produce
```css
div {
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
```
Using [Gulp].
```js
var gulp = require('gulp'),
postcss = require('gulp-postcss'),
ellipsis = require('postcss-ellipsis');
gulp.task('css', function() {
gulp.src('path/to/dev/css').
.pipe(postcss({
// use it after nesting plugins
ellipsis
}))
.pipe(gulp.dest('path/to/build/css'));
});
// rest of the gulp file
```