CSS Shadow Generator
Shadows communicate elevation but are tedious by hand. Combine multiple layers, switch inset for pressed controls, and adopt `rgb()`/`color-mix()` style colors so the output matches design tokens without endless DevTools nudging.
How to use
- Set horizontal and vertical offsets plus blur and spread for the primary shadow layer.
- Pick semi-transparent colors; duplicate layers to separate ambient and key lights for realistic depth.
- Copy the combined declaration into your stylesheet and verify contrast on light and dark themes as well as focus-visible outlines for accessibility.
FAQ
- When should I use inset shadows?
- Inset implies material pressed into the surface—inputs, wells, and toggle tracks. Outer shadows lift floating surfaces; mixing both works but avoid muddy stacks with excessive blur.
- Do huge blur radii hurt performance?
- Large blurs can strain GPUs on low-end phones. Prefer design-system elevation tokens, smaller radii, or pseudo-element tricks that animate opacity instead of massive blur transitions.
- How do I animate shadows smoothly?
- Transition sparingly—blurring is expensive. Often animate `transform`/`opacity` on a dedicated layer or use filter drop-shadow alternatives that match your motion guidelines.
CSS 阴影生成器
自由调配多图层阴影,支持内阴影及高级不透明度微调,实时输出 CSS box-shadow 及 Tailwind 样式代码。
Share Tool & Configuration
You can copy the configuration link of this page or share this tool with your friends.
shadow_layers.yaml
图层堆栈管理
#1外阴影 (0px, 10px)
#2外阴影 (0px, 8px)
shadow_parameters.conf
> 正在编辑激活图层:#1
阴影类型
X 轴偏移 (Offset X)0 px
Y 轴偏移 (Offset Y)10 px
模糊半径 (Blur Radius)25 px
扩散距离 (Spread Radius)-5 px
阴影颜色
#000000
不透明度10%
shadow_render_view.bin
Preview Box
Radius: 24px
box_shadow_styles.css
标准 CSS 代码
box-shadow: 0px 10px 25px -5px rgba(0, 0, 0, 0.1),
0px 8px 10px -6px rgba(0, 0, 0, 0.1);Tailwind CSS 类名
shadow-[0px_10px_25px_-5px_rgba(0,0,0,0.1),0px_8px_10px_-6px_rgba(0,0,0,0.1)]卡片圆角 (Border Radius)24 px
卡片填充色
#FFFFFF