- Home
- /
- Design
- /
- DMBEffectBuilder
- /
- Architecture
Architecture — EffectBuilder
Understanding how EffectBuilder manages resources and rendering.
1. Component Separation
EffectBuilder follows a strictly modular architecture. Each effect is composed of two distinct parts: the extension method (C#) which handles the Fluent API, parameter validation and class registration, and the style resource (CSS) which contains the actual visual logic, transitions and keyframes.
Effects/
Images/ → Pulse, Blur, Glow …
Sections/ → Glass, Shape, Edge …
InnerSections/ → Lift, Reveal, Hover …
wwwroot/css/ → Associated stylesheets2. Smart Resource Injection
When you call an effect method in your Razor view, the system registers that specific effect's CSS file with the PageRegistry . Only the CSS files for effects actually used on the page are injected — if you use 3 effects, only 3 tiny CSS files are loaded.
// Registered automatically when the effect is called
page.SetStylesheet("/css/imageEffect/BlurToSharpEffect.css");
page.SetStylesheet("/css/sectionEffect/GlassEffect.css");3. CSS Variable Strategy
Each effect exposes a variables class (e.g. .eb-image-effect-pulse-var ) which defines the default values. When you pass parameters to the C# method, they are injected as inline CSS variable overrides — no custom stylesheet required.
/* CSS definition */
.eb-image-effect-pulse-var {
--eb-pulse-scale: 1.05;
--eb-image-effect-duration: .3s;
}
.eb-image-effect-pulse:hover {
transform: scale(var(--eb-pulse-scale));
}Tech Stack
See it in action
Learn how the code goes from your Razor view to the final rendered HTML.
Rendering Pipeline