Styling and Theming
DevLink exports your Webflow styles as CSS, giving you full control over how components look in your React application. You can maintain design consistency while adding custom theming, responsive behavior, and component variants.
The generated CSS uses CSS @scope so styles only apply within DevLink components and don’t leak into the rest of your app, and CSS @layer to keep the generated rules at lower precedence than the styles you set in your own CSS files.
Never edit the generated files
Never edit the auto-generated React or CSS files. They will be overwritten on the next export. Always extend or override styles externally.
Global CSS setup
DevLink generates a global.css file that imports base styles, responsive breakpoints, and CSS variables in the generated code.
Import it once at your app’s root to apply Webflow’s design system globally:
By default (with the cssScopes setting enabled), the exported styles are scoped to a class via a constant named DEVLINK_SCOPE_CLASS.
To apply the scope, each exported component is wrapped in a <div> with that class, as in this example:
The constant is defined in the file devlinkScope.ts:
The generated CSS files are limited to that scope, as in this example:
Overriding CSS
The safest way to customize exported components is to attach your own CSS classes via the className prop.
This approach preserves Webflow’s original styles while adding your customizations:
Exported components already wrap their root in the DEVLINK_SCOPE_CLASS div, so you don’t need to wrap them again at the call site unless you’re styling a custom component that re-uses Webflow classes (see Reuse Webflow classes and variables below).
Reuse Webflow classes and variables
DevLink exports your Webflow project’s class names and CSS variables, enabling you to build custom components that match your design system. This approach is ideal for components with dynamic data or complex interactions that you wouldn’t build in Webflow:
Custom-built React component:
Additionally, you can reuse component classes from your Webflow project in your custom-built React components by wrapping your custom components with the container wrapper and using Webflow’s style blocks.
Custom Identifiers
DevLink automatically transforms custom IDs into safe, namespaced selectors using CSS’s @scope and @layer rules, preventing style conflicts when components are used in larger React apps.
Custom IDs are transformed into the following format:
For example, a custom ID of featured-section on a Grid element within a Hero component may become: Hero_featured-section__abc123
Use attribute selectors with wildcards to style elements reliably:
Avoid dynamic IDs
Some Webflow elements (like Grid or Quick Stack) rely on fixed IDs for CSS. If you replace them dynamically in React, the exported CSS will no longer apply. Instead, use custom attributes to keep Webflow’s styling intact while allowing you to attach your own identifier.
Don't do this
Use custom attributes instead
CSS-in-JS integration
If your project uses styled-components or emotion, you can wrap DevLink components with styled overrides. This approach works well for component variants and theme-based styling: