← Back to home

CSS At-rules

Browse all CSS at-rules with syntax, examples, and practical developer notes.

24 entries

@apply

Applies a set of CSS custom property values as a mixin — a draft feature inspired by Tailwind-style utilities.

Variables

@charset

Specifies the character encoding of the stylesheet.

Structure

@color-profile

Defines a custom color profile that can be referenced in CSS color functions.

Color

@container

Applies styles based on the size of a containing element rather than the viewport.

Responsive

@counter-style

Defines custom counter styles for use with CSS lists and counters.

Typography

@custom-media

Defines named media query aliases for reuse across stylesheets.

Responsive

@document

Applies styles only when the document matches a specific URL — a deprecated Firefox-only feature.

Structure

@font-face

Defines a custom font to be loaded and used in the document.

Typography

@font-feature-values

Defines named aliases for OpenType font features, used with font-variant-alternates.

Typography

@font-palette-values

Overrides the colors in a color font's built-in palette.

Typography

@import

Imports an external CSS file or layer into the current stylesheet.

Structure

@keyframes

Defines the intermediate steps in a CSS animation sequence.

Animation

@layer

Declares a cascade layer, giving explicit control over the order of style precedence.

Structure

@media

Applies styles conditionally based on device characteristics like screen width, resolution, or orientation.

Responsive

@namespace

Defines XML namespaces for use in CSS selectors, primarily for SVG and MathML.

Structure

@page

Modifies the margins, orientation, and size of printed pages.

Print

@position-try

Defines fallback positioning options for anchor-positioned elements when they overflow their container.

Layout

@property

Registers a custom CSS property with a defined type, initial value, and inheritance behavior.

Variables

@scope

Limits the scope of CSS rules to a specific subtree of the DOM.

Structure

@scroll-timeline

Links a CSS animation to the scroll position of a scroll container.

Animation

@starting-style

Defines the initial styles of an element before its first style transition, enabling entry animations without JavaScript.

Animation

@supports

Applies styles only if the browser supports a specific CSS property or value.

Feature Detection

@view-transition

Configures view transitions between pages or states in a document.

Animation

@viewport

Controls viewport settings directly in CSS — a deprecated alternative to the HTML meta viewport tag.

Responsive