Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cssmediaquery

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssmediaquery

CSS Media Query parser and matcher

  • 0.0.1
  • PyPI
  • Socket score

Maintainers
1

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


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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc