fela-statistics
v12.2.1
Published
Statistic generation tool for Fela
Downloads
409
Readme
fela-statistics
Statistic generation tool for Fela. It collects several information and metrics to better analyze your application CSS. Right now, it provides the following information:
- Class count
- per media query
- with/without pseudo class
- Usage per class
- CSS file size
- in bytes, kbytes, bytes (gzipped) and kbytes (gzipped)
- Reuse
- Reuse ratio (total used classes vs. total unique classes)
- total classes with pseudo classes
- total classes inside media queries
- total renders
- total used classes
Installation
yarn add fela-statistics
You may alternatively use npm i --save fela-statistics
.
Usage
Adding the statistics enhancer will add a new function to the renderer called getStatistics
.
You may call it at any given time, to get the current statistics object.
import { createRenderer } from 'fela'
import statistics from 'fela-statistics'
const renderer = createRenderer({
enhancers: [ statistics() ]
})
// rendering stuff
const stats = renderer.getStatistics()
console.log(stats)
Example
License
Fela is licensed under the MIT License. Documentation is licensed under Creative Commons License. Created with ♥ by @robinweser and all the great contributors.