npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scancss

v1.5.0

Published

A robust CSS stylesheet statistics collector and analyzer

Downloads

865

Readme

scancss

A robust CSS stylesheet statistics collector and analyzer

Build Status Build status codecov Coverage Status

CodeFactor codebeat badge Codacy Badge BCH compliance

npm version npm install size David Known Vulnerabilities

Table of contents

  1. Installation

  2. Usage

  3. Report Structure

  4. Examples

  5. Options

  6. License

Installation

npm install scancss --save
yarn add scancss --save

Back to top

Usage

import scancss from 'scancss';
// or const scancss = require('scancss');

const stylesheet = `
	.selector {
		display: inline-block;
		position: relative;
		width: 40px;
		height: 40px;
		background-color: #123123;
		color: #fff;
	}

	@media screen and (max-width: 480px) {
		.selector {
			width: 20px;
			height: 20px;
			background-color: #456456;
			color: #000;
		}
	}
`;

// Switching off some metrics
const report = scancss(
	stylesheet,
	{
		atRules: false,
		selectorsUsage: false,
		dataUris: false,
	}
);

NOTE: Without provided options object scancss will use defaults. See available Options.

Back to top

Report Structure

See Report Structure for more details.

Back to top

Examples

See examples folder with stylesheets and their corresponding reports.

Back to top

Options

size

Use this flag to fill .size metric

  • Default: true

comments

Use this flag to fill .comments metric

  • Default: true

atRules

Use this flag to fill .atRules, .mediaQueries, .keyframes, .imports metrics

  • NOTE: Disabling this flag you will disable counting browser hacks in @supports and @media at-rules

  • Default: true

rules

Use this flag to fill .rules and .selectors metrics

  • NOTE: Disabling this flag you will disable counting all .selectors metrics

  • Default: true

selectors

Use this flag to fill .selectors metric

  • NOTE: Disabling this flag you will disable counting all .selectors metrics

  • Default: true

selectorsUsage

Use this flag to fill .selectors.usage metric

  • Default: true

attributesUsage

Use this flag to fill .selectors.attributesUsage metric

  • Default: true

selectorComplexityThreshold

Use this value to set a threshold of the base parts of a selector to consider the selector as complex and to count in .selectors.complex metric

  • Default: 4

specificityGraph

Use this flag to fill .selectors.specificity.graphData metric

  • Default: false

declarations

Use this flag to fill .declarations metric

  • NOTE: Disabling this flag you will disable counting all .declarations metrics

  • Default: true

uniqueDeclarationsList

Use this flag to fill .declarations.list metric

  • Default: false

properties

Use this flag to fill .properties metric

  • NOTE: Disabling this flag you will disable counting .properties.engineTriggers and .properties.performanceHacks

  • Default: true

engineTriggerProperties

Use this flag to fill .properties.engineTriggers metric

  • Default: true

performanceHacks

Use this flag to fill .properties.performanceHacks metric

  • Default: true

displays

Use this flag to fill .displays metric

  • Default: true

positions

Use this flag to fill .positions metric

  • Default: true

zIndices

Use this flag to fill .zIndices metric

  • Default: true

floats

Use this flag to fill .floats metric

  • Default: true

borderRadiuses

Use this flag to fill .borderRadiuses metric

  • Default: true

widths

Use this flag to fill .widths metric

  • Default: true

heights

Use this flag to fill .heights metric

  • Default: true

letterSpacings

Use this flag to fill .letterSpacings metric

  • Default: true

fonts

Use this flag to fill .fontSizes, .lineHeights, .fontFamilies metrics

  • Default: true

colors

Use this flag to fill .colors metric

  • Default: true

backgroundColors

Use this flag to fill .backgroundColors metric

  • Default: true

allColors

Use this flag to fill .allColors metric

  • Default: true

transitionsAndAnimations

Use this flag to fill .transitions and .animations metrics

  • Default: true

functions

Use this flag to fill .functions metric

  • NOTE: Disabling this flag you will disable counting .gradients, .filters, .dataUris, cubic-beziers for .transitions and .animations metrics

  • Default: true

filters

Use this flag to fill .filters metric

gradients

Use this flag to fill .gradients metric

  • Default: true

units

Use this flag to fill .units metric

  • NOTE: Disabling this flag you will disable counting .properties.negativeMargins metric

  • Default: true

variables

Use this flag to fill .variables metric

  • Default: true

dataUris

Use this flag to fill .dataUris metric

  • Default: true

browserHacks

Use this flag to fill .browserHacks metric

  • Default: true

Back to top

License

MIT © Alex Orekhov @everget

Back to top