Socket
Socket
Sign inDemoInstall

postcss-js

Package Overview
Dependencies
5
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-js

PostCSS for CSS-in-JS and styles in JS objects


Version published
Weekly downloads
6.7M
decreased by-15.74%
Maintainers
1
Install size
12.2 kB
Created
Weekly downloads
 

Package description

What is postcss-js?

The postcss-js package allows you to use PostCSS, a tool for transforming CSS with JavaScript, in a JavaScript environment. This enables the processing of CSS styles with JavaScript objects, facilitating dynamic style generation and manipulation within JavaScript projects.

What are postcss-js's main functionalities?

Parsing CSS to JS Objects

This feature allows the conversion of CSS styles into JavaScript objects, making it easier to manipulate CSS properties and values programmatically.

const postcssJs = require('postcss-js');
const autoprefixer = require('autoprefixer');
const root = postcssJs.parse({ color: 'red' });
console.log(root);

Applying PostCSS Plugins

Enables the use of PostCSS plugins, such as autoprefixer, directly on JavaScript objects representing CSS styles, allowing for advanced CSS processing and manipulation.

const postcssJs = require('postcss-js');
const autoprefixer = require('autoprefixer');
const prefixer = postcssJs.sync([ autoprefixer ]); 
const prefixed = prefixer({ display: 'flex' });
console.log(prefixed);

Other packages similar to postcss-js

Readme

Source

PostCSS JS

PostCSS for CSS-in-JS and styles in JS objects.

For example, to use Stylelint or RTLCSS plugins in your workflow.

Sponsored by Evil Martians

Docs

Read full docs here.

Keywords

FAQs

Last updated on 08 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc