Skip to content

Instantly share code, notes, and snippets.

@milosdjakonovic
Created July 28, 2016 18:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milosdjakonovic/d0863620fdb9fbefa46e53926a59991a to your computer and use it in GitHub Desktop.
Save milosdjakonovic/d0863620fdb9fbefa46e53926a59991a to your computer and use it in GitHub Desktop.
Regex to match media queries and get values
/@\s*?media\s*?\(\s*?(min|max)-(width|height)\s*?:\s*?(\d+)(px|em)\s*?\)\s*?{(.*)}/gms
/**
* Only basically tested.
* Should match min-max-width-height number px|em and following rules.
* Provides capturing groups to determinate condition alongside with css.
*
* Created with help of regex101
* https://regex101.com/r/zA6fX2/1
*
**/
@SerkanSipahi
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment