
Research
/Security News
Trivy Under Attack Again: Widespread GitHub Actions Tag Compromise Exposes CI/CD Secrets
Attackers compromised Trivy GitHub Actions by force-updating tags to deliver malware, exposing CI/CD secrets across affected pipelines.
@webflow/emotion-utils
Advanced tools
A React utility package for working with [Emotion CSS-in-JS](https://github.com/emotion-js/emotion) in Shadow DOM environments. This package exposes a provider component that automatically configures Emotion's cache to work correctly within Shadow DOM bou
A React utility package for working with Emotion CSS-in-JS in Shadow DOM environments. This package exposes a provider component that automatically configures Emotion's cache to work correctly within Shadow DOM boundaries.
npm i @webflow/emotion-utils
This package requires the following peer dependencies:
npm i @emotion/cache @emotion/react react react-dom
The easiest way to use Emotion with Webflow code components is through the decorator pattern. This eliminates the need to manually wrap your component with the provider.
import { declareComponent } from "@webflow/react";
import { emotionShadowDomDecorator } from "@webflow/emotion-utils";
import styled from "@emotion/styled";
const StyledButton = styled.button`
background-color: #007bff;
color: white;
padding: 8px 16px;
`;
function MyComponent() {
return <StyledButton>Click me!</StyledButton>;
}
export default declareComponent(MyComponent, {
name: "My Component",
decorators: [emotionShadowDomDecorator],
});
You can create a custom decorator with specific Emotion cache options:
import { declareComponent } from "@webflow/react";
import { createEmotionShadowDomDecorator } from "@webflow/emotion-utils";
const customDecorator = createEmotionShadowDomDecorator({
cacheOptions: {
key: "custom-key",
},
});
export default declareComponent(MyComponent, {
name: "My Component",
decorators: [customDecorator],
});
If you prefer more control, you can manually use the EmotionCacheShadowDomProvider component.
import React from "react";
import { EmotionCacheShadowDomProvider } from "@webflow/emotion-utils";
import styled from "@emotion/styled";
const StyledButton = styled.button`
background-color: #007bff;
`;
function MyComponent() {
return (
<EmotionCacheShadowDomProvider>
<StyledButton>Click me!</StyledButton>
</EmotionCacheShadowDomProvider>
);
}
You can customize the Emotion cache by passing options to the provider:
import React from "react";
import { EmotionCacheShadowDomProvider } from "@webflow/emotion-utils";
import type { Options as CreateCacheOptions } from "@emotion/cache";
const cacheOptions: CreateCacheOptions = {
key: "my-custom-key",
// Other Emotion cache options...
};
function MyApp() {
return (
<EmotionCacheShadowDomProvider options={cacheOptions}>
{/* Your styled components */}
</EmotionCacheShadowDomProvider>
);
}
emotionShadowDomDecoratorA decorator function that wraps a component with EmotionCacheShadowDomProvider.
Type:
<P extends {}>(Component: React.ComponentType<P>) => React.ComponentType<P>;
Example:
import { emotionShadowDomDecorator } from "@webflow/emotion-utils";
const decorators = [emotionShadowDomDecorator];
createEmotionShadowDomDecoratorCreates a custom decorator with specific Emotion cache options.
Type:
(options?: EmotionDecoratorOptions) =>
<P extends {}>(Component: React.ComponentType<P>) =>
React.ComponentType<P>;
Parameters:
options (optional): Configuration options for the decorator
options.cacheOptions (optional): Custom options to pass to Emotion's createCache functionExample:
import { createEmotionShadowDomDecorator } from "@webflow/emotion-utils";
const customDecorator = createEmotionShadowDomDecorator({
cacheOptions: {
key: "my-app",
},
});
EmotionCacheShadowDomProviderA React component that provides Emotion cache configured for Shadow DOM.
| Prop | Type | Required | Description |
|---|---|---|---|
children | React.ReactNode | Yes | The React components that will use Emotion styles |
options | CreateCacheOptions | No | Custom options to pass to Emotion's createCache function |
{
key: "webflow";
// container is automatically determined based on DOM context
}
Webflow code components run inside a Shadow DOM boundary. CSS-in-JS libraries like Emotion normally inject styles into the document head, but those styles aren't accessible inside the Shadow DOM. This package ensures styles are injected into the correct location within the Shadow DOM.
MIT
FAQs
A React utility package for working with [Emotion CSS-in-JS](https://github.com/emotion-js/emotion) in Shadow DOM environments. This package exposes a provider component that automatically configures Emotion's cache to work correctly within Shadow DOM bou
The npm package @webflow/emotion-utils receives a total of 95 weekly downloads. As such, @webflow/emotion-utils popularity was classified as not popular.
We found that @webflow/emotion-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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.

Research
/Security News
Attackers compromised Trivy GitHub Actions by force-updating tags to deliver malware, exposing CI/CD secrets across affected pipelines.

Security News
ENISA’s new package manager advisory outlines the dependency security practices companies will need to demonstrate as the EU’s Cyber Resilience Act begins enforcing software supply chain requirements.

Research
/Security News
We identified over 20 additional malicious extensions, along with over 20 related sleeper extensions, some of which have already been weaponized.