Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/transformer-css

Package Overview
Dependencies
Maintainers
1
Versions
885
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-css

  • 2.13.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
251K
decreased by-6.48%
Maintainers
1
Weekly downloads
 
Created

What is @parcel/transformer-css?

@parcel/transformer-css is a plugin for the Parcel bundler that handles CSS transformations. It allows you to process CSS files, including features like CSS modules, PostCSS, and automatic vendor prefixing.

What are @parcel/transformer-css's main functionalities?

CSS Modules

CSS Modules allow you to scope CSS by automatically creating unique class names. This prevents class name collisions in larger projects.

/* styles.module.css */
.button {
  background-color: blue;
  color: white;
}

// index.js
import styles from './styles.module.css';

document.getElementById('myButton').className = styles.button;

PostCSS

PostCSS is a tool for transforming CSS with JavaScript plugins. In this example, Autoprefixer is used to add vendor prefixes to CSS rules.

/* postcss.config.js */
module.exports = {
  plugins: [
    require('autoprefixer')
  ]
};

/* styles.css */
.button {
  display: flex;
}

// index.js
import './styles.css';

Automatic Vendor Prefixing

Automatic vendor prefixing ensures that your CSS works across different browsers by adding necessary vendor prefixes.

/* styles.css */
.button {
  display: flex;
}

// index.js
import './styles.css';

Other packages similar to @parcel/transformer-css

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc