
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
css-selector-loader
Advanced tools
css selector loader module for webpack, load css selectors and their style into js
npm install css-selector-loader --save-dev
It's recommended to combine css-selector-loader
with the postcss-loader
file.css
.foo {
width: 100px;
height: 100px;
}
.bar {
width: var(--w)px;
height: var(--h)px;
}
component.js
import {
getFoo as getFooStyle
getBar as getBarStyle
} from './file.css'
fooElement.style.cssText = getFooStyle();
barElement.style.cssText = getBarStyle({
w: 50,
h: 50
});
webpack.config.js
{
module: {
rules: [
{
test: /\.css$/,
use: [
{ loader: "css-selector-loader" },
{ loader: "postcss-loader" }
]
}
]
}
}
Name | Type | Default | Description |
---|---|---|---|
root | {String} | ./ | helps inline local url(...)'s as data-uri's |
camelCase | {Boolean} | true | Enable/disable transfering css selectors into camel-case |
useVarTemplate | {Boolean} | true | Enable/disable use function arguments to replace with css variables |
root
webpack.config.js
{
loader: 'css-selector-loader',
options: {
root: path.resolve(__dirname, 'css')
}
}
camelCase
webpack.config.js
{
loader: 'css-selector-loader',
options: {
camelCase: false
}
}
useVarTemplate
webpack.config.js
{
loader: 'css-selector-loader',
options: {
useVarTemplate: false
}
}
FAQs
css selector loader module for webpack, load css selectors and their style into js
The npm package css-selector-loader receives a total of 0 weekly downloads. As such, css-selector-loader popularity was classified as not popular.
We found that css-selector-loader 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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.