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-raw

v0.1.2

Published

Output nodes inside the @raw at-rule, untouched by other plugins

Downloads

60

Readme

npm version Build Status

PostCSS Raw

PostCSS plugin to output nodes inside the @raw at-rule, untouched by other plugins in the plugin stack.

Latest Version: v0.1.0

Changelog

Install

npm install postcss-raw --save-dev

Usage

postcss-raw is a two-part process. First we inspect(require('postcss-raw').inspect()) and record any child nodes in the @raw at-rule and remove them from the AST tree. This way other plugins can't touch what was inside. Then when you run the write(require('postcss-raw').write()), we put those child nodes back in place without the wrapping @raw at-rule.

Basic Example

var postcss = require('postcss');
var raw = require('postcss-raw');
// ES6 modules:
//import { inspect as rawInspect, write as rawWrite } from 'postcss-raw';

var fs = require('fs');

var mycss = fs.readFileSync('input.css', 'utf8');

// Process your CSS with postcss-reverse-media
var output = postcss([
		raw.inspect(/*options*/),
		// other plugins...
		raw.write(/*options*/)
	])
	.process(mycss)
	.css;

console.log(output);

Input:

@raw {
	@import "variables";
	$foo: #f00;
}

Output:

@import "variables";
$foo: #f00;

Options

  • atRuleKeyword: string - The media query name keyword that applies the plugin.
    • Default: 'raw'

Testing

npm test