![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
babel-plugin-object-styles-to-template
Advanced tools
Babel plugin to transpile object styles to template literal
Babel plugin to transpile object styles to template literal.
The plugin will convert styles written in object syntax to tagged template literal which libraries like linaria
and styled-components
can consume.
Install the plugin:
yarn add --dev babel-plugin-object-styles-to-template
Then include it in your .babelrc
:
{
"plugins": ["object-styles-to-template"]
}
When you write the following:
const container = css({
flex: 1,
padding: 10,
backgroundColor: 'orange',
color: colors.white,
'&:hover': {
backgroundColor: 'tomato',
},
});
It's transpiled to:
const container = css`
flex: 1;
padding: 10px;
background-color: orange;
color: ${colors.white};
&:hover {
background-color: tomato;
}
`;
The styled components syntax is also supported. So when you write the following:
const FancyButton = styled(Button)({
backgroundColor: 'papayawhip',
});
It's transpiled to:
const FancyButton = styled(Button)`
background-color: papayawhip;
`;
You can selectively enable/disable the tags transpiled by the plugin:
css: boolean
: Whether to transpile css
tags. Default: true
.styled: boolean
: Whether to transpile styled components like styled
tags. Default true
.To pass options to the plugin, you can use the following syntax:
{
"plugins": [
["object-styles-to-template", { "css": true, "styled": false }]
]
}
FAQs
Babel plugin to transpile object styles to template literal
The npm package babel-plugin-object-styles-to-template receives a total of 0 weekly downloads. As such, babel-plugin-object-styles-to-template popularity was classified as not popular.
We found that babel-plugin-object-styles-to-template 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.