Skip to content

kirang89/css-mediaquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-mediaquery

Build Status PyPI version

Parses and determines if a given CSS Media Query matches a set of values.

This is a port of https://github.com/ericf/css-mediaquery.

Usage

from cssmediaquery import match, parse

isamatch = match('screen and (min-width: 40em)', {
	'type'  : 'screen',
	'width' : '1024px'
})
# returns True

ast = parse('screen and (min-width: 40em)')
print ast
# [
#    {
#        'inverse': 'false',
#        'type'   : 'screen',
#        'expressions': [{
#                'modifier': 'min',
#                'feature': 'width',
#                'value': '40em'
#         }]
#    }
# ]

Installing

$ pip install cssmediaquery

Running Tests

python tests.py -v

About

Parses and determines if a given CSS Media Query matches a set of values. This is a port of https://github.com/ericf/css-mediaquery.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages