Security News
Nightmares on npm: How Two Malicious Packages Facilitate Data Theft and Destruction
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.
@bumbag/create-emotion
Advanced tools
The main emotion package can be thought of as a call to createEmotion
with sensible defaults for most applications.
import createEmotion from 'create-emotion'
export const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
injectGlobal,
keyframes,
css,
sheet,
cache
} = createEmotion()
Calling it directly will allow for some low level customization.
Create custom names for emotion APIs to help with migration from other, similar libraries.
Could set custom key
to something other than css
Introduces some amount of complexity to your application that can vary depending on developer experience.
Required to keep up with changes in the repo and API at a lower level than if using emotion
directly
Using emotion in embedded contexts such as an <iframe/>
Setting a nonce on any <style/>
tag emotion creates for security purposes
Use emotion with a developer defined <style/>
tag
Using emotion with custom stylis plugins
import createEmotion from 'create-emotion'
export const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
injectGlobal,
keyframes,
css,
sheet,
cache
} = createEmotion({
// The key option is required when there will be multiple instances in a single app
key: 'some-key'
})
createEmotion
accepts the same options as createCache from @emotion/cache
.
FAQs
The Next Generation of CSS-in-JS.
We found that @bumbag/create-emotion demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.
Security News
A senior white house official is urging insurers to stop covering ransomware payments, indicating possible stricter regulations to deter cybercrime.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.