All Projects → kubosho → postcss-stylestats

kubosho / postcss-stylestats

Licence: MIT license
[Unmainted] PostCSS plugin for StyleStats.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to postcss-stylestats

react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (+38.46%)
Mutual labels:  postcss-plugins
Stencil Postcss
Autoprefixer plugin for Stencil
Stars: ✭ 19 (+46.15%)
Mutual labels:  postcss-plugins
Postcss High Contrast
Create high contrast version of your project with ease.
Stars: ✭ 108 (+730.77%)
Mutual labels:  postcss-plugins
postcss-copy
An async postcss plugin to copy all assets referenced in CSS files to a custom destination folder and updating the URLs.
Stars: ✭ 39 (+200%)
Mutual labels:  postcss-plugins
Postcss Cssnext
`postcss-cssnext` has been deprecated in favor of `postcss-preset-env`.
Stars: ✭ 5,388 (+41346.15%)
Mutual labels:  postcss-plugins
Postcss At Rules Variables
PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else and more...
Stars: ✭ 52 (+300%)
Mutual labels:  postcss-plugins
postcss-clip-path-polyfill
PostCSS plugin which add SVG hack for clip-path property to make it work in Firefox
Stars: ✭ 24 (+84.62%)
Mutual labels:  postcss-plugins
Rucksack
A little bag of CSS superpowers, built on PostCSS
Stars: ✭ 1,861 (+14215.38%)
Mutual labels:  postcss-plugins
Postcss Start To End
PostCSS plugin that lets you control your layout (LTR or RTL) through logical rather than physical rules
Stars: ✭ 18 (+38.46%)
Mutual labels:  postcss-plugins
Postcss Plugins
The "officially unofficial" consolidated list of PostCSS plugins in a ready-to-use package
Stars: ✭ 107 (+723.08%)
Mutual labels:  postcss-plugins
Postcss Utilities
PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS
Stars: ✭ 293 (+2153.85%)
Mutual labels:  postcss-plugins
Postcss Sorting
PostCSS plugin to keep rules and at-rules content in order.
Stars: ✭ 438 (+3269.23%)
Mutual labels:  postcss-plugins
Postcss Nested Ancestors
👩‍👧‍👦 PostCSS plugin to reference any parent/ancestor selector in nested CSS.
Stars: ✭ 79 (+507.69%)
Mutual labels:  postcss-plugins
usedcss
PostCSS plugin which helps you extract only used styles.
Stars: ✭ 52 (+300%)
Mutual labels:  postcss-plugins
Postcss Instagram
📷 PostCSS plugin for using Instagram filters in CSS
Stars: ✭ 111 (+753.85%)
Mutual labels:  postcss-plugins
postcss-namespace
PostCSS plugin that prefix a namespace to a selector
Stars: ✭ 16 (+23.08%)
Mutual labels:  postcss-plugins
Postcss Selector Not
PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to more compatible CSS (multiple css3 :not() selectors)
Stars: ✭ 49 (+276.92%)
Mutual labels:  postcss-plugins
Stylefmt
stylefmt is a tool that automatically formats stylesheets.
Stars: ✭ 2,123 (+16230.77%)
Mutual labels:  postcss-plugins
Postcss Aspect Ratio Mini
A PostCSS plugin to fix an element's dimensions to an aspect ratio
Stars: ✭ 123 (+846.15%)
Mutual labels:  postcss-plugins
Postcss Font Family System Ui
PostCSS plugin to transform W3C CSS font-family: system-ui to a practical font-family list
Stars: ✭ 91 (+600%)
Mutual labels:  postcss-plugins

[Unmainted] postcss-stylestats

No longer actively maintaining this project due to lack of motivation. This project and source code keep on GitHub and on npm, but no longer maintaining in my side.

Build Status David npm

PostCSS plugin for StyleStats.

Examples

input (input.css)

div {
    width: 300px;
    height: 300px;
    margin: 10px;
    padding: 10px;
    background-color: #003760;
    color: #fff;
    text-align: center;
}

output (CSS statistics data for StyleStats)

┌─────────────────────────────────┬───────────────────────────┐
│ Published                       │ December 30, 2016 2:36 PM │
├─────────────────────────────────┼───────────────────────────┤
│ Paths                           │ N/A                       │
├─────────────────────────────────┼───────────────────────────┤
│ Style Sheets                    │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Style Elements                  │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Size                            │ 154B                      │
├─────────────────────────────────┼───────────────────────────┤
│ Data URI Size                   │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Ratio of Data URI Size          │ 0.0%                      │
├─────────────────────────────────┼───────────────────────────┤
│ Gzipped Size                    │ 126B                      │
├─────────────────────────────────┼───────────────────────────┤
│ Rules                           │ 1                         │
├─────────────────────────────────┼───────────────────────────┤
│ Selectors                       │ 1                         │
├─────────────────────────────────┼───────────────────────────┤
│ Declarations                    │ 7                         │
├─────────────────────────────────┼───────────────────────────┤
│ Simplicity                      │ 100.0%                    │
├─────────────────────────────────┼───────────────────────────┤
│ Average of Identifier           │ 1.000                     │
├─────────────────────────────────┼───────────────────────────┤
│ Most Identifier                 │ 1                         │
├─────────────────────────────────┼───────────────────────────┤
│ Most Identifier Selector        │ div                       │
├─────────────────────────────────┼───────────────────────────┤
│ Average of Cohesion             │ 7.000                     │
├─────────────────────────────────┼───────────────────────────┤
│ Lowest Cohesion                 │ 7                         │
├─────────────────────────────────┼───────────────────────────┤
│ Lowest Cohesion Selector        │ div                       │
├─────────────────────────────────┼───────────────────────────┤
│ Total Unique Font Sizes         │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Unique Font Sizes               │ N/A                       │
├─────────────────────────────────┼───────────────────────────┤
│ Total Unique Font Families      │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Unique Font Families            │ N/A                       │
├─────────────────────────────────┼───────────────────────────┤
│ Total Unique Colors             │ 1                         │
├─────────────────────────────────┼───────────────────────────┤
│ Unique Colors                   │ #FFFFFF                   │
├─────────────────────────────────┼───────────────────────────┤
│ Total Unique Background Images  │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Unique Background Images        │ N/A                       │
├─────────────────────────────────┼───────────────────────────┤
│ ID Selectors                    │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Universal Selectors             │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Unqualified Attribute Selectors │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ JavaScript Specific Selectors   │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Important Keywords              │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Float Properties                │ 0                         │
├─────────────────────────────────┼───────────────────────────┤
│ Properties Count                │ width: 1                  │
│                                 │ height: 1                 │
│                                 │ margin: 1                 │
│                                 │ padding: 1                │
│                                 │ background-color: 1       │
│                                 │ color: 1                  │
│                                 │ text-align: 1             │
├─────────────────────────────────┼───────────────────────────┤
│ Media Queries                   │ 0                         │
└─────────────────────────────────┴───────────────────────────┘

Install

npm install --save-dev postcss-stylestats

Usage

const fs = require('fs');
const stylestats = require('postcss-stylestats');

const css = fs.readFileSync('input.css', 'utf-8');

postcss([stylestats])
    .process(css)
    .then((result) => {
        if (result.messages[0].stats) {
            console.log(result.messages[0].stats);
        }
    });

Option

type

Output format specify. Default is table. Option specify example.

Can spefify format to json, html and md.

Contributions

We welcome your pull requests.

  1. Fork the repo and create your branch from master.
  2. Create your feature branch: git checkout -b foo-bar.
  3. Commit your changes: git commit -am 'Add awesome feature'.
  4. Push to the branch: git push origin foo-bar.
  5. Ensure the test suite passes.
  6. Submit Pull Request!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].