
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
hash-css-selector
Advanced tools
A function to hash CSS selectors, can be used with postcss-modules to generate short static unique class names
A function to hash CSS selectors, can be used with postcss-modules to generate short static unique class names.
hashCSSSelector returns a 8 character long hash of the given string. The function is deterministic, so the same input will always result in the same output.
import { hashCSSSelector } from 'hash-css-selector';
hashCSSSelector('test-class'); // -> 'm-a530cc7d'
hashCSSSelector('another-test-class'); // -> 'm-c43ac187'
// Default prefix is 'm'
// Customize prefix by passing a second argument
hashCSSSelector('test-class', 'my-prefix'); // -> 'my-prefix-a530cc7d'
With default m prefix:
import { generateScopedName } from 'hash-css-selector';
postcss([
require('postcss-modules')({
generateScopedName: generateScopedName,
}),
]);
With custom prefix:
import { createGenerateScopedName } from 'hash-css-selector';
postcss([
require('postcss-modules')({
generateScopedName: createGenerateScopedName('custom-prefix'),
}),
]);
MIT
FAQs
A function to hash CSS selectors, can be used with postcss-modules to generate short static unique class names
The npm package hash-css-selector receives a total of 355 weekly downloads. As such, hash-css-selector popularity was classified as not popular.
We found that hash-css-selector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.