CSS light-level Media Feature

Beginner
5 min read
Updated: Oct 2026
3 examples
Historical

Definition and Usage

The light-level media feature was a proposed query for ambient light around the device: dim, normal, or washed.

The goal was to adapt contrast for dark rooms or bright sunlight. It was never implemented in browsers and was removed from Media Queries Level 5 as redundant with prefers-contrast and prefers-color-scheme. Study the syntax for history exams — do not ship it for production UI.

Removed Never implemented

MDN deleted the reference page. CSSWG removed the feature from the spec. @media (light-level: …) will not match in current browsers.

Use instead.

Prefer readable defaults, then enhance with prefers-color-scheme and prefers-contrast for theme and contrast preferences.

CSS Syntax

syntax.css
@media (light-level: dim | normal | washed) { … }

Historical form only. Parentheses were required, same as other media features.

Feature Values

ValueHistorical meaningTry it
dimLow ambient light (night / dim room)Try it
normalTypical indoor lightingTry it
washedVery bright / glare (sunlight on screen)Try it
All threeCompare the three historical branches in one fileTry it

How to Study light-level (Not Ship It)

Learn the old keywords, then map them to modern alternatives.

  1. Recognize the three historical values: dim, normal, washed.
  2. Remember: no browser matches these queries today.
  3. For theme, use prefers-color-scheme.
  4. For contrast needs, use prefers-contrast and strong default contrast.
PieceRequired?Role
Historical syntaxFor studyKnow the three keywords and @media form
Production useNoWill never match — dead code
Modern alternativeYesprefers-color-scheme / prefers-contrast
Default stylesAlwaysReadable without any ambient-light query

Live Preview

matchMedia on this device. Expect no matches — that confirms the feature is unavailable.

Detected light-level queries

Chips stay inactive when the browser ignores light-level (expected everywhere today).

Ambient light detection

light-level is not implemented

(light-level: dim) (light-level: normal) (light-level: washed)

Checking…

CSS Examples

Historical study snippets. View Output shows the intended look; real queries do not apply in browsers. Use Try It Yourself to inspect the syntax.

Example 1 — Historical Dim Styles

What authors once proposed for low ambient light.

CSS
p {
  background: #f1f5f9;
  color: #334155;
}

@media (light-level: dim) {
  p {
    background: #222;
    color: #ccc;
  }
}
Try It Yourself

How It Works

  1. Default first. Light slate styles work without the query.
  2. Historical branch. @media (light-level: dim) was meant for dark rooms.
  3. Lower glare. Darker background and softer text for low light.
  4. Reality check. No engine implements this — you always see the default.

Example 2 — Historical Washed Styles

What authors once proposed for bright outdoor glare.

CSS
p {
  background: #f1f5f9;
  color: #334155;
}

@media (light-level: washed) {
  p {
    background: #fff;
    color: #000;
    font-weight: 700;
  }
}
Try It Yourself

How It Works

  1. Keep a default. Everyday indoor styles remain the base.
  2. Historical washed. Meant for sunlight washing out the screen.
  3. Max contrast. Pure black on white and bolder weight.
  4. Today: Prefer prefers-contrast and strong defaults instead.

Example 3 — Modern Replacement Pattern

What to write instead of light-level in real projects.

CSS
p {
  background: #f8fafc;
  color: #0f172a;
}

@media (prefers-color-scheme: dark) {
  p {
    background: #0f172a;
    color: #e2e8f0;
  }
}

@media (prefers-contrast: more) {
  p {
    color: #000;
    border: 2px solid currentColor;
  }
}
Try It Yourself

How It Works

  1. Skip light-level. It will never match.
  2. Theme with prefers-color-scheme. Light/dark user preference.
  3. Boost contrast with prefers-contrast. When users ask for more contrast.
  4. Keep defaults solid. Ambient-light sensors are not required.

Edge Cases & Pitfalls

Treat this feature as exam trivia, not a shipping API.

removed

Gone from the spec

Media Queries Level 5 dropped light-level. Old drafts and mirrors are not a green light to use it.

engines

Zero browser support

Chrome, Firefox, Safari, and Edge never shipped it. Queries silently fail to match.

dead code

Do not leave it in production CSS

It adds weight and false confidence. Prefer working prefers-* features.

vs dark

Not a dark-mode switch

Ambient light ≠ theme preference. Use prefers-color-scheme for light/dark UI.

privacy

Sensors were a concern

Ambient-light based styling raised privacy/fingerprinting questions — another reason preference media features won.

Browser Support

light-level was specified as a browser media feature, but no engine shipped it. Node.js, Deno, and Bun do not evaluate it either.

✓ Removed · No support

light-level

Never implemented. Removed from Media Queries Level 5. MDN deleted the reference page. Do not use in production.

0% Engine support
Google Chrome —
No support
Mozilla Firefox —
No support
Apple Safari —
No support
Microsoft Edge —
No support
Opera —
No support
Samsung Internet —
No support
Internet Explorer —
No support
@media (light-level) Not implemented

Bottom line: Historical knowledge only. Ship prefers-color-scheme and prefers-contrast instead. It is not a runtime API.

Key Takeaways

  • Was: ambient light query with dim / normal / washed.
  • Status: removed from the spec; never implemented.
  • Replace with: prefers-color-scheme and prefers-contrast.
  • Production: do not include light-level rules.

One line: know light-level for history; build with preference media features that actually ship.

Frequently Asked Questions

It was a proposed media feature to test ambient light around the device: dim, normal, or washed. The idea was to adapt contrast for dark rooms or bright sunlight.
No. It was never implemented in any browser and was removed from Media Queries Level 5. Queries will not match. Use solid defaults plus prefers-color-scheme and prefers-contrast.
The CSS Working Group removed it as redundant with prefers-contrast and prefers-color-scheme, which can cover similar adaptation goals without relying on ambient light sensors.
Three historical keywords: dim (low light), normal (typical lighting), and washed (very bright / glare).
No. Dark mode is prefers-color-scheme. light-level was about physical ambient light, not the user’s theme preference.
No. Even historically it was specified as a CSS media feature for the browser layout engine, not a Node.js or server runtime feature.

Next: monochrome

Learn the monochrome media feature for one-bit and grayscale displays.

monochrome tutorial →

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.

8 people found this page helpful