---
title: CSS Conditional Rules
slug: Web/CSS/CSS_Conditional_Rules
tags:
  - CSS
  - CSS Conditional Rules
  - Guide
  - Overview
  - Reference
spec-urls: https://drafts.csswg.org/css-conditional/
---
{{CSSRef}}

**CSS Conditional Rules** is a CSS module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to.

## Reference

### At-rules

- {{cssxref("@document")}}
- {{cssxref("@media")}}
- {{cssxref("@supports")}}
- {{cssxref("@import")}}

## Specifications

{{Specifications}}

## Browser compatibility

### `@document` rule

{{Compat("css.at-rules.document")}}

### `@import` rule

{{Compat("css.at-rules.import")}}

### `@media` rule

{{Compat("css.at-rules.media")}}

### `@supports` rule

{{Compat("css.at-rules.supports")}}
