Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MopicMP/critical-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

critical-css

Extract critical above-fold CSS

Installation

pip install critical-css

Quick Start

from critical_css import css

# Basic usage
result = css("your input here")
print(result)

Features

  • Simple, clean API with type hints
  • Zero dependencies (pure Python)
  • Python 3.8+ compatible
  • Fully tested
  • Lightweight (< 5KB)

API Reference

css(input)

Main utility function.

Parameters:

  • input -- The input data to process

Returns: Processed result

batch(inputs)

Process multiple inputs at once.

Parameters:

  • inputs -- List of inputs

Returns: List of results

Examples

from critical_css import css

# Example 1: Basic usage
result = css("Hello World")

# Example 2: Batch processing
from critical_css import batch
results = batch(["item1", "item2", "item3"])

Running Tests

pip install pytest
pytest tests/

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.


Learn More

Want to build tools like this? Check out the Website From Scratch course -- it teaches you step-by-step how to create useful Python utilities from scratch, with real-world projects and best practices.

Built with skills from Website From Scratch

About

Extract critical above-fold CSS

Topics

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages