fade-in() is a global Sass helper documented in the sass:color module page (Deprecated Functions). It makes a legacy color more opaque by increasing alpha by $amount at compile time. This page covers the fixed-amount trap, the opacify alias, why the module system skipped it, how it differs from color.scale(), migration to color.adjust(), and five compiled examples.
01
Concept
Add alpha 0–1
02
Status
Deprecated global
03
Alias
opacify()
04
Prefer
color.scale()
05
Same math
color.adjust()
06
Practice
5 examples
Concept
What Is fade-in()?
Fade-in means “make this color less see-through.” Official docs: it increases the alpha channel of $color by $amount (0–1). RGB (or HSL) stays the same; only transparency moves toward solid by a fixed chunk.
Fixed addition is like pouring the same cup of paint into every glass. A glass that is already almost full (alpha 0.7) overflows to solid. Relative scaling is like “fill 30% of the remaining empty space”—that is color.scale.
Foundation
📝 Syntax
Call the global function (or its alias) with a legacy color and an alpha step:
Must be in a legacy color space (rgb, hsl, or hwb).
$amount
Number
How much to add to alpha, between 0 and 1 (inclusive).
Return value
Type
Meaning
Color
A more opaque color (may clamp to fully opaque when alpha hits 1).
Modules
📦 Why There Is No color.fade-in()
Official docs: because fade-in() is usually not the best way to make a color more opaque, it is not included in the new module system. You will not find color.fade-in or color.opacify after @use "sass:color".
styles.scss
// Old (deprecated globals — same result)
$fill: fade-in(rgba(#6b717f, 0.5), 0.2);
$fill: opacify(rgba(#6b717f, 0.5), 0.2);
@use "sass:color";
// Same fixed addition as fade-in
$fill: color.adjust(rgba(#6b717f, 0.5), $alpha: 0.2);
// Usually better — 20% more opaque relative to the original
$fill: color.scale(rgba(#6b717f, 0.5), $alpha: 20%);
⚠️
Migration note
Matching old fade-in math means adding alpha with color.adjust($c, $alpha: $amount). Prefer color.scale($c, $alpha: $percent) when you redesign overlays and hover fills.
Compare
📋 fade-in vs color.scale vs color.adjust
Official docs call out this trap with rgba(#036, 0.7) (already mostly opaque):
Call
Result
Why
fade-in(rgba(#036, 0.7), 0.3)
#036 (opaque)
Adds 0.3 alpha to 0.7 → clamps to 1
color.scale(rgba(#036, 0.7), $alpha: 30%)
rgba(0, 51, 102, 0.79)
Moves 30% of the way toward full opacity
color.adjust(..., $alpha: 0.3)
Same fixed math as fade-in
Use only when you need identical legacy behavior
Support
🛠 Compatibility
This is about Sass compilers, not browsers. Compiled CSS receives a finished color—no fade-in() call remains at runtime.
Examples use deprecated global fade-in() / opacify() plus modern scale / adjust migrations. Open View Compiled CSS for verified output (matches official Sass docs samples).
📚 Getting Started
Official docs samples for everyday fade-in amounts.
Example 1 — Alpha 0.5 → 0.9 (Official Docs)
A soft taupe wash becomes more solid by a fixed 0.4 alpha.
opacify and fade-in are interchangeable. When you migrate, treat both names as the same deprecated step.
📈 Practical Patterns
The opaque trap, preferred scale, and adjust migration.
Example 3 — High Alpha + Amount → Solid (Official Docs)
Alpha 0.7 plus 0.3 clamps to fully opaque.
styles.scss
// rgba(#036, 0.7) has alpha 0.7, so when fade-in() adds 0.3 it returns a fully
// opaque color.
@debug fade-in(rgba(#036, 0.7), 0.3); // #036
.deep {
color: fade-in(rgba(#036, 0.7), 0.3);
}
📤 Compiled CSS:
.deep {
color: #003366;
}
How It Works
This is the classic reason official docs discourage fade-in. You asked for “a bit more opaque,” but fixed math wiped the transparency out. (Dart Sass may emit #003366, the same navy as shorthand #036.)
Example 4 — Prefer color.scale() (Official Docs)
Same seed color, relative 30% opacity keeps a usable translucent navy.
styles.scss
@use "sass:color";
// scale() instead makes it 30% more opaque than it was originally.
@debug color.scale(rgba(#036, 0.7), $alpha: 30%); // rgba(0, 51, 102, 0.79)
.deep {
--fade-in: #{fade-in(rgba(#036, 0.7), 0.3)};
--scale: #{color.scale(rgba(#036, 0.7), $alpha: 30%)};
}
Safe migrations — swap to color.adjust for identical output, or scale for better UX.
Teaching alpha — show fixed alpha steps vs relative scaling.
Audit traps — find fade-in on already-opaque washes that snap to solid.
Pairing with transparentize — both globals are deprecated twins; migrate together.
🧠 How Compilation Works
1
Write SCSS
Call fade-in($c, 0.2) or migrate to scale / adjust.
Source
2
Read alpha
Sass works on the alpha channel of legacy rgb/hsl/hwb colors.
Alpha
3
Add $amount
Alpha rises by a fixed step; may clamp at 1.
Fade-in
4
✓
Finished CSS color
Browsers see rgba() / hex—not a Sass function call.
Watch Out
⚠️ Common Pitfalls
Using it in new code — prefer color.scale (or adjust for same math).
Expecting color.fade-in() — that name does not exist in sass:color.
High alpha + large amounts — easy to clamp to fully opaque unexpectedly.
Modern color spaces — $color must be legacy for global fade-in.
Confusing with color.opacity() — that helper reads alpha; fade-inwrites a new color.
Pro Tips
💡 Best Practices
✅ Do
Use color.scale($c, $alpha: $n) for relative opacity
Use color.adjust(..., $alpha: $n) when matching old fade-in
Audit already-opaque washes before applying large amounts
Migrate opacify aliases in the same pass
Document overlay recipes with the modern API
❌ Don’t
Add new fade-in() / opacify() calls in greenfield projects
Look for color.fade-in in the module
Pass modern oklch colors into global fade-in
Expect the browser to re-run Sass at runtime
Assume fixed alpha steps feel “30% more opaque”
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about fade-in()
Deprecated fixed alpha adder—prefer scale.
5
Core concepts
📝01
Call
fade-in($c, 0–1)
API
⚠️02
Status
Deprecated
Docs
🔄03
Alias
opacify()
Twin
📈04
Prefer
color.scale()
Modern
✓05
Same math
color.adjust(…)
Migrate
❓ Frequently Asked Questions
fade-in($color, $amount) increases a legacy color’s alpha by $amount (0–1). Example: fade-in(rgba(#e1d7d2, 0.5), 0.4) is rgba(225, 215, 210, 0.9); fade-in(rgba(#036, 0.7), 0.3) is fully opaque #036.
Yes. Official Sass docs list fade-in($color, $amount) and opacify($color, $amount) as aliases that return the same color.
Yes. Official Sass docs list it under Deprecated Functions and omit it from the sass:color module. Prefer color.scale() for relative opacity changes, or color.adjust($color, $alpha: $amount) to keep the old math.
Because fade-in() is usually not the best way to make a color more opaque, it is not included in the new module system. Use color.scale or color.adjust instead.
fade-in adds a fixed alpha amount (0.7 + 0.3 becomes fully opaque). color.scale($c, $alpha: 30%) makes the color 30% more opaque than it was, which is usually what designers want.
For the same fixed addition: color.adjust($color, $alpha: $amount). For better relative opacity: color.scale($color, $alpha: $percent). opacify() migrates the same way.
Did you know?
Official Sass docs keep fade-in() and opacify() as the same helper for compatibility, but neither lives in sass:color. The modern story is color.scale for relative opacity and color.adjust when you must match the old fixed math exactly.
fade-in() (alias opacify()) is the classic global way to add alpha on legacy colors. Treat it as deprecated documentation: prefer color.scale($color, $alpha: $percent) for relative opacity, or color.adjust when you need identical old math.