Last active
August 27, 2017 17:33
-
-
Save creativcoder/dccaeb83e40f874bdafbf593b64772f9 to your computer and use it in GitHub Desktop.
In components/script/test.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use app_units::Au; | |
use style::servo::media_queries::{ExpressionKind, Range}; | |
use style::media_queries::{MediaQuery, MediaQueryType}; | |
use style::media_queries::{Expression}; | |
use style::values::specified::{Length, NoCalcLength, AbsoluteLength}; | |
pub fn test_media_query(len: i32) -> MediaQuery { | |
// try this updated line below, we just imported AbsoluteLength which is an enum and use its Px variant | |
let length = Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(len))); | |
let expr = Expression(ExpressionKind::Width(Range::Max(length))); | |
let media_query = MediaQuery { | |
qualifier: None, | |
media_type: MediaQueryType::All, | |
expressions: vec![expr] | |
}; | |
media_query | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment