express-inline-css
Express inline CSS generator
Last updated 2 years ago by jlopezxs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install express-inline-css 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.3.0                                ...           latest (2 years ago)

10 Versions

  • 1.3.0                                ...           2 years ago
  • 1.2.6                                ...           3 years ago
  • 1.2.5                                ...           3 years ago
  • 1.2.4                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.4                                ...           3 years ago
  • 1.1.3                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 20
Last Month 20
Dependencies (3)
Dev Dependencies (20)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |