🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@parcel/transformer-css

Package Overview
Dependencies
Maintainers
1
Versions
929
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-css

2.12.0
Source
npm
Version published
Weekly downloads
283K
-16.58%
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 28 Feb 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