@srivtx/tomato-css
v1.1.0
Published
π Tomato - The Human-Friendly CSS Preprocessor. Write CSS like you think.
Maintainers
Readme
π Tomato CSS
The Human-Friendly CSS Preprocessor
Write CSS like you think. Components, Tailwind colors, and human-readable syntax.
Installation
Global Install (Recommended)
npm install -g @srivtx/tomato-cssNow use it anywhere:
tomato app.tom -o styles.cssProject Install
cd your-project
npm install @srivtx/tomato-cssThen use with npx:
npx tomato app.tom -o styles.cssOr add to package.json scripts:
{
"scripts": {
"build:css": "tomato src/styles.tom -o dist/styles.css",
"watch:css": "tomato --watch src/styles.tom -o dist/styles.css"
}
}No Install (npx)
npx @srivtx/tomato-css app.tom -o styles.cssQuick Start
Create a file called styles.tom:
component btn:
pad 2 4
round lg
pointer
smooth
button:
use btn
bg blue-500
color white
hover:
bg blue-600
shadow lgCompile it:
tomato styles.tom -o styles.cssFeatures
- π¦ Reusable Components - Define once, use everywhere
- π¨ Tailwind Colors - All 22 color scales built-in
- β¨ Human Syntax - Write
row spreadnotdisplay: flex; justify-content: space-between - π± Responsive -
@mobile:,@tablet:,@desktop: - β‘ Fast - Lightning-fast compilation
- π Watch Mode - Auto-recompile on save
Syntax Reference
Selectors
button: # HTML element
.btn-primary: # Class selector
#header: # ID selector
card: # Auto-becomes .cardComponents
component btn:
pad 2 4
round lg
pointer
smooth
button:
use btn
bg blue-500Pseudo States
button:
bg blue-500
hover:
bg blue-600
focus:
ring 2px solid blue-400
disabled:
opacity 0.5Responsive Design
hero:
pad 16
grid 3
@mobile:
pad 4
grid 1
@tablet:
grid 2Custom Tokens
colors:
primary blue-500
secondary violet-500
dark slate-900
button:
bg primary
color whiteFile Imports
@import "components.tom"
@import "./buttons.tom"
button:
use btnCLI Usage
# Compile single file
tomato app.tom
# Custom output
tomato app.tom -o styles.css
# Watch mode
tomato --watch app.tomVS Code Extension
Get the Tomato CSS VS Code Extension for the best development experience!
Installation
π₯ Download from GitHub Releases
- Download
tomato-css-1.0.0.vsixfrom the latest release - Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Click
...menu β "Install from VSIX..." - Select the downloaded file
Or install via command line:
code --install-extension /path/to/tomato-css-1.0.0.vsixFeatures
- β¨ Syntax highlighting for
.tomfiles - π¨ Tomato file icons
- π Error detection & diagnostics
- π‘ Smart autocomplete
- π§ Typo suggestions
Property Reference
| Tomato | CSS |
|--------|-----|
| bg blue-500 | background: #3b82f6 |
| color white | color: #ffffff |
| pad 2 4 | padding: 0.5rem 1rem |
| round lg | border-radius: 0.5rem |
| shadow md | box-shadow: ... |
| row | display: flex; flex-direction: row |
| row spread | ...justify-content: space-between |
| center all | ...justify-content: center; align-items: center |
| grid 3 | display: grid; grid-template-columns: repeat(3, 1fr) |
| bold | font-weight: bold |
| pointer | cursor: pointer |
| smooth | transition: all 0.2s ease |
Colors
All Tailwind colors are built-in:
slate, gray, zinc, neutral, stone
red, orange, amber, yellow, lime
green, emerald, teal, cyan, sky
blue, indigo, violet, purple
fuchsia, pink, rose
# Shades: 50-950
bg rose-500
color slate-900License
MIT Β© srivtx
π Fresh styles, no ketchup required.
