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

postcss-docta

v2.0.0

Published

PostCSS plugin for Docta projects

Downloads

1

Readme

PostCSS Docta Build Status

PostCSS plugin that provides several improvements according to the Docta project guidelines.

Improvements

This plugin is not configurable (nor will it be) because it was created to meet specific guidelines. Any issue or push request must consider that the configurations are (and will be) unalterable. See configurations in the plugins folder.

charset

Remove all existing charset at-rules and add one at the beginning with utf-8 value.

Before:

.foo {
}

After:

@charset "utf-8";

.foo {
}

comments

Remove all comments, include marked as important.

Before:

/*! Example of important comment */

.foo {
}

After:

.foo {
}

mqtoem

Transform min/max-width/height media queries to em units.

Before:

@media (min-width: 960px) {
  .foo {
  }
}

After:

@media (min-width: 60em) {
  .foo {
  }
}

mqpacker

Group same media queries and then sort.

Before:

@media (min-width: 48em) {
  .foo {
  }
}

.foo {
}

@media (min-width: 60em) {
  .bar {
  }
}

@media (min-width: 48em) {
  .baz {
  }
}

After:

.foo {
}

@media (min-width: 48em) {
  .foo {
  }

  .baz {
  }
}

@media (min-width: 60em) {
  .bar {
  }
}

pxtorem

Transform px units to rem units.

Before:

.foo {
  font-size: 14px;
}

After:

.foo {
  font-size: 0.875rem;
}

values

Ensure values are ordered consistently.

Before:

.foo {
  border: solid 0.0625rem red;
}

After:

.foo {
  border: 0.0625rem solid red;
}

prefix

Add or remove vendor prefixes as necessary.

Before:

.foo {
  text-decoration: underline dotted;
}

After:

.foo {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

banner

Add a banner at the beginning with the data of package.json.

Before:

.foo {
}

After:

/*! postcss-docta v1.0.0 - Released under the MIT license */

.foo {
}

eol

Normalize all line ends with \n.

Options

min

  • Type: Boolean
  • Default: false

If the value is true, it will minify the styles with clean-css. If the value is false (by default), the styles will be formatted with several plugins: clean-css, perfectionist, csscomb and prettier. Keep in mind that the application of these plugins is not redundant (although it seems that yes) because each one offers its own advantages with respect to the others.

Usage

postcss([require("postcss-docta")]);

See PostCSS docs for examples for your environment.

Everything has a reason

For example, the separation of the banner in the minified styles, is to solve a problem of syntax highlighting in Sublime Text. Any doubt, ask me.