Skip to main content

CSS Media Query parser and matcher

Project description

## css-mediaquery

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

```python

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cssmediaquery-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cssmediaquery-0.0.1-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cssmediaquery-0.0.1.tar.gz.

File metadata

  • Download URL: cssmediaquery-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cssmediaquery-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9ff25675f99d83c86f1f5cb8239a5465383dffd7c8e2f66fb0f4848ff884b614
MD5 285d27de3e8e3c0a932ee7a6b9e7a8a7
BLAKE2b-256 d78d76070fe461091aa820cd82bf891de3875571b79dba01cf5f799dcf66ad92

See more details on using hashes here.

File details

Details for the file cssmediaquery-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cssmediaquery-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 373c7beb26fe45349e0954a05d7b81babe0b61462076891c1ce61f7d55b9bfdd
MD5 8996fb7c77d6cc0574792428b4107a36
BLAKE2b-256 a80b024b36535cb90e676bed6956783fb173b71a9e594e156d6d59c2f23146d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page