Skip to main content

Python CSS declaration computer

Project description

# cssdecl Python CSS declaration computer

This package provides basic computation of CSS declarations in order to:

  • handle overwriting of properties

  • expand shorthands like border-width: 0 5px into border-top-width: 0, border-right-width: 5px, border-bottom-width: 0, border-left-width: 5px

  • (TODO!) expand shorthands like font: 5px sans-serif bold into font-family: sans-serif, font-size: 5px, font-weight: bold

  • resolve sizes to a common unit (i.e. pt)

  • resolve inherit given some inherited declarations

It does not process CSS selectors and their applicability to elements, including specificity.

Some properties that are not shorthands in CSS 2.2 become shorthands in CSS 3, such as text-decoration. We therefore hope to provide CSS22Resolver and CSS3Resolver.

This was first developed for use in [Pandas](pandas.pydata.org) ([#15530](https://github.com/pandas-dev/pandas/pull/15530)). Issues will continue to be prioritised to improve CSS support there, in the absence of other clear use-cases.

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

cssdecl-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file cssdecl-0.1.1.tar.gz.

File metadata

  • Download URL: cssdecl-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cssdecl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40b2481622cc805930ae35309d09527b49ba5f7c12545cdc844d8f6240e9495b
MD5 b6f421becf8f14843de7bf821ccd80c2
BLAKE2b-256 c86a5620e9f501f2332fe11fa3fc227a73458dc0d0ac43fce81d622906708789

See more details on using hashes here.

Supported by

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