
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
babel-plugin-transform-inline-localize-css-import
Advanced tools
**Inline and localize `import theme from './Component.css'` to {classNames, code}.
Inline and localize import theme from './Component.css' to {classNames, code}.
This is similar to css modules localize as it will allow you to localize class names and animations.
Combining with substack/insert-css provides a simple solution component based website or libraries styling.
npm install babel-plugin-transform-inline-localize-css-import --save-dev
.babelrc
{
"plugins": [
["babel-plugin-transform-inline-localize-css-import", {
"localFormat": "$cssFilename__$token"
}]
]
}
Component.js
import theme from './Component.css';
Component.css
.item {
color: blue;
}
.itemSelected {
color: yellow;
animation-name: hide;
}
@keyframes hide {0%{opacity:0}}
babel Component.js
# var theme = {
# classNames: {
# item: 'Component__item',
# itemSelected: 'Component__itemSelected'
# },
# code: 'Component__item \n{ color: blue}\n\nComponent__itemSelected \n{ color: yellow;\nanimation-name: Component__hide }\n\n@keyframes Component__hide {0%{opacity: 0}}'
# }
string): How to localize tokens. Available variables:
$cssFilename: Filename, without extension, of the imported CSS file.$jsFilename: Filename, without extension of the module JavaScript file.$token: Current class name or animation-name to replace.Runs tests and lint.
npm test
Runs tests in watch mode.
npm run dev
npm run release
FAQs
**Inline and localize `import theme from './Component.css'` to {classNames, code}.
We found that babel-plugin-transform-inline-localize-css-import 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
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.