Next generation CSS
Project description
Astric
Next generation CSS.
█████╗ ███████╗████████╗██████╗ ██╗ ██████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██╔════╝
███████║███████╗ ██║ ██████╔╝██║██║
██╔══██║╚════██║ ██║ ██╔══██╗██║██║
██║ ██║███████║ ██║ ██║ ██║██║╚██████╗
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝
Table of Contents
Features
Astric is a lightweight CSS preprocessor that simplifies the way you write CSS. It offers the following features:
- Python-like Syntax: Write CSS using a Python-like syntax.
- Simplicity: Write clean, maintainable, and scalable CSS.
- Optionals: Semicolons are optional. If you want to use them, you can (and is required for single-line properties).
- Variables: Define reusable values using the
$symbol. - Loops: Generate repetitive CSS with ease using
--forand--endfor. - Comments: Add comments to your Astric files.
- Compact Output: Use the
--compactflag to compact outputted CSS onto one line.
Syntax
Astric introduces a simple and powerful syntax to enhance your CSS workflow. Here are some key features:
Variables
Define reusable values using the $ symbol.
$primary-color: #3498db;
$spacing: 16px;
body
color: $primary-color;
margin: $spacing;
Loops
Generate repetitive CSS with ease using --for and --endfor.
--for $i from 1 to 3
.item-$i
width: calc(100% / $i)
--endfor
Comments
Add comments to your Astric files. Comments will be stripped out in the generated CSS.
// Singleline comment
>> Another singleline comment
These features make Astric a powerful tool for writing clean, maintainable, and scalable CSS.
Usage
To use Astric, follow these steps:
-
Download the library:
pip3 install Astric
-
Prepare your
.astrfile: Create a.astrfile with your Astric syntax. For example, create a file namedexample.astr:$primary-color: #3498db $spacing: 16px body color: $primary-color margin: $spacing --for $i from 1 to 3 .item-$i width: calc(100% / $i) --endfor -
Run Astric: Use the
Astriccommand to process your.astrfile and generate the corresponding CSS file:Astric example.astr output.css
-
Check the output: The generated CSS will be written to
output.css. You can open this file to see the processed CSS:body { color: #3498db; margin: 16px; } .item-1 { width: calc(100% / 1); } .item-2 { width: calc(100% / 2); } .item-3 { width: calc(100% / 3); }
-
Compact (optional): You can use the
--compactflag to compact outputted CSS onto one line.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astric-1.0.0.tar.gz.
File metadata
- Download URL: astric-1.0.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db496d79fb0ba04f8250a295894c76bbb7f94cdc5603e3c41dadd6d152815bb0
|
|
| MD5 |
1b850bddd7a739623366765300540f65
|
|
| BLAKE2b-256 |
7d830d76ae174bce5af619e517f8fb58c24a2f11bf3b6ef69f48001b42e55bcf
|
File details
Details for the file astric-1.0.0-py3-none-any.whl.
File metadata
- Download URL: astric-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
195b7894c47bb83b96492322c28b87961b701868fec809b58f915885cc3a80f1
|
|
| MD5 |
3e285a644051fd6623211815bb98d874
|
|
| BLAKE2b-256 |
5c691cab801594959d5277d6583924c809b8bac920a6b040364b66d72a7d41de
|