Skip to content
Back to skills

Css Alpha Masking

ASecurity

Apply CSS alpha masking with linear-gradient for horizontal or

  • 63 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 2, 2026
ai-agentsgo

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add nota-america/forgecat-agent-profiles --skill css-alpha-masking --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Css Alpha Masking?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Css Alpha Masking
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nota-america-css-alpha-masking/badge)](https://www.skillsdirectory.com/skills/nota-america-css-alpha-masking)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: css-alpha-masking
description: Apply CSS alpha masking with linear-gradient for horizontal or
  vertical edge fades (mask-image and -webkit-mask-image). Use when asked for
  alpha masks, fade edges, or CSS mask gradients.
---

# CSS Alpha Masking Skill

## Workflow
1. Confirm direction (horizontal or vertical) and fade stop percentages.
2. Provide the inline CSS snippet and any needed class usage.
3. Offer small tweaks only (direction, stop positions, colors).

## Usage checklist
- Apply the mask styles directly on the element or in a CSS class.
- Always include both `mask-image` and `-webkit-mask-image` for Safari.
- Ensure the element has visible content; masks reveal/hide alpha only.

## Horizontal (left/right) fade
```css
/* Add this inline CSS to any element */
mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
-webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
```

## Vertical (top/bottom) fade
```css
/* Add this inline CSS to any element */
mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
-webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
```

## Customization knobs
- Direction: `to right`, `to left`, `to bottom`, `to top`.
- Fade depth: adjust `15%` and `85%` stops.
- Strength: change `transparent` to `rgba(0,0,0,0.2)` for softer fades.

## Common pitfalls
- Forgetting the `-webkit-mask-image` fallback in Safari.
- Expecting masks to work on elements with `overflow: hidden` but no visible content behind.

## Questions to ask when specs are missing
- Which direction should the fade go?
- How wide should the fade edges be?
- Is this for images, text, or a container background?

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…