Octacube Typed Cascading Style Sheets (TCSS) is a typed preprocessor that brings strict typing to CSS without compromising performance.
TCSS supports modular imports, external rule definitions, abstract interfaces, and inline CSS blocks.
Use import to bring in standard libraries or external resources.
import std;
import @<url>;
Use extern rule to define global scope styles. Variables marked as virtual are compiled into CSS variables (custom properties).
extern rule body {
virtual color shadow = #000000; // Compiles to --shadow
display.mode display = none;
}
You can define structured styles using classes, which compile into standard CSS class selectors.
class button
{
size width = 40px;
size { height, maxWidth } = 120px;
}
Define reusable structures using abstract interfaces. Use default to set fallback values.
abstract IButton {
abstract size width;
size height = 20px;
color color = default #00ff00;
}
Use the extern css </> block to write standard CSS directly, with syntax highlighting support.
extern css </>
.logo {
display: none;
}
</>
Classes can extend interfaces or other classes. You can also define collection classes for grouping multiple selectors.
class button extends IButton
{
size width = 123;
extern css </>
display: flex;
</>
}
collection class A, B extends AB {
size width = 123;
}
collection class(A:AC, B:BC) {}
haxelib git octa-tcss https://github.com/Kriptel/Octa-tcss.git dev
You can compile your TCSS files using the Haxe library runner.
Execute the following command in your terminal:
haxelib run octa-tcss [options]
Available Options:
| Option | Description |
|---|---|
-i, --input <file> |
Set input file |
-o, --output <file> |
Set output file |
-d, --dir <path> |
Append directory to the list of search paths |
-f, --force |
Overwrite output files without asking for confirmation |
--suggestion |
Enable suggestions |
--enableRecovery |
Try to recover from CSS errors |