Getting Started
Get up and running with SenangStart CSS in minutes.
Requirements
| Environment | Minimum Version |
|---|---|
| Node.js | 18+ |
| npm | 9+ |
| Modern browsers | Chrome 90+, Firefox 90+, Safari 15+, Edge 90+ |
Note: The JIT runtime requires a browser with ES6+ support (
MutationObserver,Set, arrow functions). For legacy browsers (IE11), use the CLI to pre-compile a static CSS file.
CDN (Zero Build) Recommended for prototyping
The fastest way to try SenangStart — no build step required:
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<!-- Just add this single script -->
<script src="https://unpkg.com/@bookklik/senangstart-css/dist/senangstart-css.min.js"></script>
</head>
<body>
<div
layout="flex col center"
space="p:big"
visual="bg:primary text:white rounded:big"
>
<h1 visual="text-size:giant font:bold">Hello SenangStart!</h1>
<p space="m-t:small">Zero config, instant styling.</p>
</div>
</body>
</html>How CDN JIT Works
- Scans DOM — Finds all
layout,space, andvisualattributes - Generates CSS — Compiles styles on-the-fly in the browser
- Injects Styles — Creates
<style>tags with compiled CSS - Watches Changes — Uses MutationObserver for dynamic updates
Custom CDN Config
<script type="senangstart/config">
{
"theme": {
"colors": {
"brand": "#8B5CF6",
"accent": "#EC4899"
}
}
}
</script>
<script src="https://unpkg.com/@bookklik/senangstart-css/dist/senangstart-css.min.js"></script>WARNING
CDN JIT is perfect for prototyping and learning. For production, use the CLI build for better performance.
CLI (Production) Recommended for production
Installation
# Install globally
npm install -g @bookklik/senangstart-css
# Or use npx
npx @bookklik/senangstart-css initInitialize Config
senangstart initThis creates senangstart.config.js in your project root.
Add to HTML
<head>
<link rel="stylesheet" href="./public/senangstart.css">
</head>Start Development
senangstart devThis watches your files and rebuilds on changes.
Build for Production
senangstart build --minifyYour First Component
Let's create a simple card:
<div
layout="flex col"
space="w:[320px] p:medium"
visual="bg:white rounded:big shadow:medium"
>
<div layout="flex between" space="m-b:big">
<span visual="font:bold text-size:big">Profile</span>
<span visual="text:primary">Edit</span>
</div>
<div layout="flex col" space="g:small">
<label visual="text:grey text-size:small">Username</label>
<div visual="text:dark">@senang_dev</div>
</div>
</div>What's happening:
layout="flex col"— Flexbox, vertical directionspace="w:[320px] p:medium"— 320px width, medium paddingvisual="bg:white rounded:big shadow:medium"— White background, rounded corners, shadow
For AI Assistants
If you are using AI coding assistants (like Cursor, Windsurf, or others), you can provide them with our specialized context file. This file contains the full list of available references and usage instructions in a format optimized for LLMs.
File location: https://bookklik-technologies.github.io/senangstart-css/llms.txt
Next Steps
- Tri-Attribute Syntax — Deep dive into layout, space, visual
- The Natural Scale — Understand spacing philosophy
- Configuration — Customize the theme