Skip to main content

A Python-native utility-first CSS generator and compiler.

Project description

TailPySCSS v0.4.0

The Python-Native Utility CSS Engine for Clean HTML

TailPySCSS is a lightweight, zero-node utility CSS system. It gives you the power of utility classes (like Tailwind) but focuses on keeping your HTML clean by using SCSS BEM methodologies.

100% Python. 100% Open Source.

Created by Abdi Abdikarim


🚀 New in v0.4.0 (The 3x Bundle)

  • Universal Python Bridge: Automatically generates tailpyscss_theme.py effectively synching your frontend design tokens with your Python backend (Flask/Django/FastAPI).
  • Smart Config: Validated Python-based configuration (tailpy_config.py) with 100% Security Sanitization preventing CSS injections.
  • Performance Core: Smart MD5 Caching & 0.1s Watch Debounce for instant feedback.

📦 Installation

You can install TailPySCSS via pip or from source.

Option 1: Install via PyPI

pip install tailpyscss

Option 2: Install from Source (Development)

If you want to contribute or modify the framework:

pip install -e .

Auto-Setup for Windows

The installation attempts to automatically run:

python -m tailpyscss.cli setup-path

This adds the generic Python Scripts folder to your Windows PATH so you can use the tailpyscss command globally.

[!NOTE] Command not found? If the automatic setup failed and Windows can't find the tailpyscss command, run the setup manually:

python -m tailpyscss.cli setup-path

Then restart your terminal.

⚡ Quick Start

1. Initialize

Go to your project folder and run:

tailpyscss init

(Or use python -m tailpyscss.cli init)

This creates:

  • tailpy_config.py (Your Python-based Settings!)
  • styles/ folder (Your SCSS)

2. Build or Watch

To build once:

tailpyscss build

To watch for changes (0.1s response time):

tailpyscss watch

3. The Universal Bridge (Backend Magic)

When you run build, we generate tailpyscss_theme.py. Use it in your Python code!

import tailpyscss_theme

print(tailpyscss_theme.COLORS['primary']) 
# Output: #3b82f6 (Synced directly from your CSS logic!)

4. The Core Philosophy: Clean HTML & BEM

The main objective of TailPySCSS is to separate structure (HTML) from implementation (CSS). Instead of cluttering your HTML with classes, use SCSS BEM and the custom @apply directive.

Your SCSS (styles/main.scss):

.card {
    @apply flex flex-col bg-white p-6 rounded-lg shadow-lg;

    &__header {
        @apply text-2xl font-bold text-dark mb-4;
    }

    &__button {
        @apply px-4 py-2 bg-primary text-white rounded hover:bg-secondary transition-colors;
    }
}

⚙️ Configuration (tailpy_config.py)

We now use Native Python for configuration. Pure dynamic power.

config = {
    "colors": {
        "primary": "#3b82f6",
        "secondary": "#ec4899",
        "dark": "#1f2937",
        "light": "#f3f4f6"
    },
    # ... screens, spacing, typography
}

[!IMPORTANT] Security Guarantee: All configuration values are strictly sanitized. Attempts to inject CSS (e.g., "; body { display: none }") will raise a Security Alert and stop the build.


📚 Documentation


📄 License

MIT License. Free for commercial and private use.

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

tailpyscss-0.4.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

tailpyscss-0.4.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file tailpyscss-0.4.0.tar.gz.

File metadata

  • Download URL: tailpyscss-0.4.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tailpyscss-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7d084efdf57180d95afe8effaec99f6b5b778505ee6ef764004b790219e86488
MD5 d3437574051fa1d680b402579ec14b3e
BLAKE2b-256 407cc7eba4c4df282fb679609a74bcc39985d2c4ddd985f5e5567e3de4a60868

See more details on using hashes here.

File details

Details for the file tailpyscss-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: tailpyscss-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tailpyscss-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af3866cf9aefc51bf3418b139037b5ca35b800a51c35b14e0efab2f88999a712
MD5 fd438c95d3ffadd0a1b8ad9dc501f15e
BLAKE2b-256 0cd284dc95a3e1e9b14bfdd3505c44dec03bdc6b9fe5958362c3be17c27863b9

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