Sass
CSS preprocessor

Sass fade-in() Function

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
Deprecated
Global · Dart Sass

What You’ll Learn

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

What Is fade-in()?

Fade-in means “make this color less see-through.” Official docs: it increases the alpha channel of $color by $amount (01). RGB (or HSL) stays the same; only transparency moves toward solid by a fixed chunk.

  • fade-in(rgba(#e1d7d2, 0.5), 0.4)rgba(225, 215, 210, 0.9)
  • opacify(rgba(#6b717f, 0.5), 0.2)rgba(107, 113, 127, 0.7)
  • fade-in(rgba(#036, 0.7), 0.3)#036 (fully opaque)
💡
Beginner tip

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.

📝 Syntax

Call the global function (or its alias) with a legacy color and an alpha step:

styles.scss
// Deprecated globals (legacy colors only) — aliases
fade-in($color, $amount)
opacify($color, $amount)

// Preferred — relative opacity
@use "sass:color";
color.scale($color, $alpha: $percent)

// Same fixed math as fade-in
color.adjust($color, $alpha: $amount)

Parameters

ParameterTypeDescription
$colorColorMust be in a legacy color space (rgb, hsl, or hwb).
$amountNumberHow much to add to alpha, between 0 and 1 (inclusive).

Return value

TypeMeaning
ColorA more opaque color (may clamp to fully opaque when alpha hits 1).

📦 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.

📋 fade-in vs color.scale vs color.adjust

Official docs call out this trap with rgba(#036, 0.7) (already mostly opaque):

CallResultWhy
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-inUse only when you need identical legacy behavior

🛠 Compatibility

This is about Sass compilers, not browsers. Compiled CSS receives a finished color—no fade-in() call remains at runtime.

FeatureDart SassNotes
Global fade-in() / opacify()Yes (deprecated)Legacy colors only; omitted from sass:color
color.scale($alpha: …)Yes (module)Preferred relative opacity change
color.adjust($alpha: …)Yes (module)Same fixed math as fade-in
LibSass / Ruby SassGlobals likelyLack modern module APIs

⚡ Quick Reference

GoalCode
fade-in 0.4 (legacy)fade-in(rgba(#e1d7d2, 0.5), 0.4)rgba(225, 215, 210, 0.9)
opacify aliasopacify(rgba(#6b717f, 0.5), 0.2)rgba(107, 113, 127, 0.7)
Overshoot trapfade-in(rgba(#036, 0.7), 0.3)#036
Relative opacitycolor.scale(rgba(#036, 0.7), $alpha: 30%)rgba(0, 51, 102, 0.79)
Same math as fade-incolor.adjust($c, $alpha: 0.2)
Read alpha insteadcolor.opacity($c) / color.channel($c, "alpha")

Examples Gallery

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.

styles.scss
@debug fade-in(rgba(#e1d7d2, 0.5), 0.4); // rgba(225, 215, 210, 0.9)

.card {
  background: rgba(#e1d7d2, 0.5);
  &.strong {
    background: fade-in(rgba(#e1d7d2, 0.5), 0.4);
  }
}

How It Works

Sass adds 0.4 to alpha and emits a finished rgba(). Fine when there is room below 1—risky when the color is already mostly opaque.

Example 2 — opacify() Alias (Official Docs)

Same API, different name: alpha 0.5 + 0.2 → 0.7.

styles.scss
@debug opacify(rgba(#6b717f, 0.5), 0.2); // rgba(107, 113, 127, 0.7)

.overlay {
  --wash: #{rgba(#6b717f, 0.5)};
  --solidish: #{opacify(rgba(#6b717f, 0.5), 0.2)};
}

How It Works

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);
}

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%)};
}

How It Works

Side-by-side: fade-in collapses to solid; scale keeps alpha near 0.79. Prefer scale in new SCSS.

Example 5 — Preserve Old Math with color.adjust()

Match fade-in(rgba(#6b717f, 0.5), 0.2) exactly when migrating.

styles.scss
@use "sass:color";

.tokens {
  --legacy: #{fade-in(rgba(#6b717f, 0.5), 0.2)};
  --adjust: #{color.adjust(rgba(#6b717f, 0.5), $alpha: 0.2)};
  --brand: #{fade-in(rgba(#336699, 0.2), 0.3)};
}

How It Works

--legacy and --adjust match, so you can swap calls without visual diffs. Still consider scale when you redesign overlay tokens.

🚀 Real-World Use Cases

  • Reading legacy SCSS — recognize fade-in() / opacify() in older overlays.
  • 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.

⚠️ 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-in writes a new color.

💡 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”

Key Takeaways

Knowledge Unlocked

Five things to remember about fade-in()

Deprecated fixed alpha adder—prefer scale.

5
Core concepts
⚠️ 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.

Conclusion

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.

Continue with color.red(), color.scale(), or opacify().

Next: color.red()

You learned deprecated fade-in()—next, read the RGB red channel with color.red().

color.red() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful