Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kirang89/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.
https://github.com/kirang89/css-mediaquery
css css-mediaquery media-queries python
Last synced: 7 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/kirang89/css-mediaquery
- Owner: kirang89
- License: mit
- Created: 2017-06-12T07:50:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-24T23:26:56.000Z (over 7 years ago)
- Last Synced: 2024-11-05T16:52:37.542Z (9 days ago)
- Topics: css, css-mediaquery, media-queries, python
- Language: Python
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## css-mediaquery
[![Build Status](https://travis-ci.org/kirang89/css-mediaquery.svg?branch=master)](https://travis-ci.org/kirang89/css-mediaquery) [![PyPI version](https://badge.fury.io/py/cssmediaquery.svg)](https://badge.fury.io/py/cssmediaquery)
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 Trueast = 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