| Crates.io | tcss-cli |
| lib.rs | tcss-cli |
| version | 1.0.0 |
| created_at | 2025-12-24 16:23:50.640605+00 |
| updated_at | 2025-12-24 16:23:50.640605+00 |
| description | Command-line interface for TCSS (Thematic CSS) compiler |
| homepage | https://github.com/tosiiko/TCSS |
| repository | https://github.com/tosiiko/TCSS |
| max_upload_size | |
| id | 2003542 |
| size | 160,246 |
A powerful CSS preprocessor that adds functions, variables, and expressions to CSS with Python-style indentation.
Version 1.0.0 - Production Ready! ๐
All 12 Phases: COMPLETE โ
TCSS/
โโโ tcss-core/ # Core compiler library โ
โ โโโ src/
โ โ โโโ lexer.rs # Tokenizer โ
โ โ โโโ parser.rs # AST parser โ
โ โ โโโ executor.rs # Function executor โ
โ โ โโโ generator.rs # CSS generator โ
โ โ โโโ import.rs # Import processor โ
โ โ โโโ resolver.rs # Path resolver โ
โ โ โโโ builtins/ # Built-in functions โ
โ โโโ tests/ # Comprehensive test suite โ
โโโ tcss-cli/ # Command-line interface โ
โโโ tcss-wasm/ # WebAssembly bindings โ
โโโ tcss-js/ # JavaScript wrapper โ
โโโ docs/ # Complete documentation โ
โโโ examples/ # Example projects โ
# Using Cargo
cargo install tcss-cli
# Using npm
npm install tcss-js
styles.tcss:
@var primary: #3498db
@var spacing: 16px
@fn button-padding(size):
return size * spacing
.button:
background: primary
padding: button-padding(1)
border-radius: 4px
color: white
.button:hover:
background: lighten(primary, 10)
tcss compile styles.tcss -o styles.css
.button {
background: #3498db;
padding: 16px;
border-radius: 4px;
color: white;
}
.button:hover {
background: #5dade2;
}
@var primary-color: #3498db
@var base-spacing: 16px
@fn spacing(multiplier):
return multiplier * base-spacing
.card:
padding: spacing(2)
background: primary-color
// Color manipulation
.button:
background: darken(#3498db, 10)
border-color: lighten(#3498db, 10)
color: rgba(255, 255, 255, 0.9)
// Math operations
.box:
width: max(100px, 50%)
padding: clamp(16px, 2vw, 32px)
// String utilities
.text:
font-family: uppercase("arial")
@import './colors.tcss'
@import './theme/base.tcss'
@import '@tcss/core'
.button:
background: primary
Run the comprehensive test suite:
# Run all tests
cargo test
# Run specific test suite
cargo test --test integration_tests
cargo test --test e2e_tests
# Run with coverage
cargo tarpaulin --out Html
Test Coverage: 80%+
# Compile a file
tcss compile input.tcss -o output.css
# Compile with minification
tcss compile input.tcss -o output.css --minify
# Watch for changes
tcss watch input.tcss -o output.css
use tcss_core::{Lexer, Parser, Executor, Generator};
let source = r#"
@var primary: #3498db
.button:
background: primary
"#;
let mut lexer = Lexer::new(source);
let tokens = lexer.tokenize()?;
let mut parser = Parser::new(tokens);
let program = parser.parse()?;
let mut executor = Executor::new();
let executed = executor.execute(&program)?;
let mut generator = Generator::new();
let css = generator.generate(&executed)?;
import { compile } from 'tcss-js';
const tcss = `
@var primary: #3498db
.button:
background: primary
`;
const css = compile(tcss);
<link rel="tcss" href="styles.tcss">
<script type="module">
import { init } from './tcss-js/index.js';
await init();
</script>
Contributions are welcome! Please read our Contributing Guide for details.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by TCSS Contributors
Current Version: 1.0.0 - Production Ready! ๐