lewp_css/domain/at_rules/media/
qualifier.rs

1// This file is part of css. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/css/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2017 The developers of css. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/css/master/COPYRIGHT.
3
4use {cssparser::ToCss, std::fmt};
5
6/// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
7#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
8pub enum Qualifier {
9    /// Hide a media query from legacy UAs:
10    /// <https://drafts.csswg.org/mediaqueries/#mq-only>
11    Only,
12
13    /// Negate a media query:
14    /// <https://drafts.csswg.org/mediaqueries/#mq-not>
15    Not,
16}
17
18impl ToCss for Qualifier {
19    fn to_css<W: fmt::Write>(&self, dest: &mut W) -> fmt::Result {
20        use self::Qualifier::*;
21
22        let ident = match *self {
23            Only => "only",
24
25            Not => "not",
26        };
27
28        dest.write_str(ident)
29    }
30}