1.3.0 • Published 6 years ago

express-inline-css v1.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

express-inline-css

:zap: Express middleware to generate inline critical rendering CSS to improve render performance

Build Status Dependencies Status Styled with Prettier Commitizen friendly Greenkeeper badge

Installation

npm install --save express-inline-css

Preview

// Overriding the render method

import express from 'express';
import inlineCSS from 'express-inline-css';

const app = express();

app.use(inlineCSS({
  override: true,
  cssFilePath: '../client/public/css/style.css'
}));

app.get('/', (req, res) => {
  res.render('index', {});
});
// Using renderInlineCSS method

import express from 'express';
import inlineCSS from 'express-inline-css';

const app = express();

app.use(inlineCSS({
  override: false,
  cssFilePath: '../client/public/css/style.css'
}));

app.get('/', (req, res) => {
  res.renderInlineCSS('index', {});
});

Usage

inlineCSS({ cssFilePath, override });

where:

  • cssFilePath: Path of the final css file where rules are taken out.
  • override (optional): It brings you the possibility to override the method render or use renderInlineCSS method.

License

MIT © Jordi López

1.3.0

6 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.1

7 years ago