Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::AtRule Struct Reference

Rules starting with an @ are called At-Rules, and are used to define CSS features such as @media, @font-face, @keyframes, etc. More...

#include "donner/css/Rule.h"

Collaboration diagram for donner::css::AtRule:
[legend]

Public Member Functions

 AtRule (RcString name)
 Construct the AtRule with the given name.
 
bool operator== (const AtRule &other) const
 Equality operator.
 

Public Attributes

RcString name
 Name of the at-rule, such as media, font-face, keyframes, etc.
 
std::vector< ComponentValueprelude
 List of component values before the block definition.
 
std::optional< SimpleBlockblock
 Block for the at-rule's definition, if any.
 

Friends

std::ostream & operator<< (std::ostream &os, const AtRule &rule)
 Output a human-readable parsed representation of AtRule to the given stream.
 

Detailed Description

Rules starting with an @ are called At-Rules, and are used to define CSS features such as @media, @font-face, @keyframes, etc.

For example, the following is a valid at-rule:

@media (min-width: 600px) {
a > b { color: red }
}

Note that @charset is a special rule, which does not show up as an AtRule, but it is used to inform the parsing behavior. For example, if the first rule is @charset "utf-8";, then this will not show up in the list of rules, but the parser will be in UTF-8 mode.

Constructor & Destructor Documentation

◆ AtRule()

donner::css::AtRule::AtRule ( RcString name)
explicit

Construct the AtRule with the given name.

Parameters
nameName of the at-rule.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const AtRule & rule )
friend

Output a human-readable parsed representation of AtRule to the given stream.

Parameters
osOutput stream.
ruleAtRule to output.

The documentation for this struct was generated from the following files: