Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@

`Style-Forge.Colors` is an atomic CSS palette generator based on the HSL color model. Generate exactly the colors you need — programmatically, interactively, or by name. Perfect for design systems, theming, and scalable UIs.

## 🚀 Quick Start

```bash
npx sf.color
```

or use the full name:

```bash
npx style-forge.colors
```

## ✨ What you can do
* 🎨 Generate atomic HSL-based CSS color files
* ⚙️ Run fully in terminal — no JavaScript or framework required
* 🔁 Combine selected .css files into a palette
* 📦 Use in Tailwind, Vue, React, Svelte, or raw CSS

## 🎨 Supported Input Formats

| Format | Example Input | Example Output |
|--------|-------------------|--------------------------|
| `HSL` | `259 100 42` | `hsl(259, 100%, 42%)` |
| `RGB` | `120 200 255` | `rgb(120, 200, 255)` |
| `HEX` | `#FF00AA` | `#ff00aa` |

You can use any of the above formats when generating a color CSS file.
The output includes a fully scoped, theme-aware CSS module for light, dark, and auto modes.

## 🎯 Modifier Suffixes

Style-Forge Colors provides utility modifiers to fine-tune element behavior:
Expand Down
3 changes: 0 additions & 3 deletions generators/styleBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ export function generateSingleColorCSS(H, S, L) {
lines.push(`${SELECTOR}, ${SELECTOR}\\:st { color: ${LUM}; background-color: ${HSL} }`)

// Text
// lines.push(`${SELECTOR}\\:txt { color: hsl(${H}, ${S}%, ${L > 50 ? 10 : L}%) }`)
lines.push(`${SELECTOR}\\:txt, ${SELECTOR}\\:txt\\:st, ${SELECTOR}\\:txt\\:rv { color: ${HSL} }`)

lines.push('')

// dark
lines.push(`html[data-theme='dark'] ${SELECTOR}, html.dark ${SELECTOR} { color: ${TX_LUM_REV}; background-color: ${BG_LUM_REV} }`)
lines.push(`html[data-theme='dark'] ${SELECTOR}\\:st, html.dark ${SELECTOR}\\:st { color: ${LUM}; background-color: ${HSL} }`)
// lines.push(`html[data-theme='dark'] ${SELECTOR}\\:txt, html.dark ${SELECTOR}\\:txt { color: hsl(${H}, ${S}%, ${L < 50 ? 100 - L : L}%) }`)
lines.push(`html[data-theme='dark'] ${SELECTOR}\\:txt, html.dark ${SELECTOR}\\:txt { color: hsl(${H}, ${S}%, ${90}%) }`)
lines.push(`html[data-theme='dark'] ${SELECTOR}\\:txt\\:st, html.dark ${SELECTOR}\\:txt\\:st { color: ${HSL} }`)
lines.push(`html[data-theme='dark'] ${SELECTOR}\\:txt\\:rv, html.dark ${SELECTOR}\\:txt\\:rv { color: hsl(${H}, ${S}%, ${10}%) }`)
Expand All @@ -44,7 +42,6 @@ export function generateSingleColorCSS(H, S, L) {
lines.push(`@media (prefers-color-scheme: dark) {`)
lines.push(` html[data-theme='auto'] ${SELECTOR}, html.auto ${SELECTOR} { color: ${TX_LUM_REV}; background-color: ${BG_LUM_REV} }`)
lines.push(` html[data-theme='auto'] ${SELECTOR}\\:st, html.auto ${SELECTOR}\\:st { color: ${LUM}; background-color: ${HSL} }`)
// lines.push(` html[data-theme='auto'] ${SELECTOR}\\:txt, html.auto ${SELECTOR}\\:txt { color: hsl(${H}, ${S}%, ${L < 50 ? 100 - L : L}%) }`)
lines.push(` html[data-theme='auto'] ${SELECTOR}\\:txt, html.auto ${SELECTOR}\\:txt { color: hsl(${H}, ${S}%, ${90}%) }`)
lines.push(` html[data-theme='auto'] ${SELECTOR}\\:txt\\:st, html.auto ${SELECTOR}\\:txt\\:st { color: ${HSL} }`)
lines.push(` html[data-theme='auto'] ${SELECTOR}\\:txt\\:rv, html.auto ${SELECTOR}\\:txt\\:rv { color: hsl(${H}, ${S}%, ${10}%) }`)
Expand Down
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ async function main() {
},
])

if (mode === 'Exit') process.exit(0)
if (mode === '🚪 Exit') {
console.log('\n👋 Bye!')
process.exit(0)
}

let format = config.defaultFormat || 'HSL'

Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "style-forge.colors",
"version": "2025.5.12",
"description": "Style-Forge Colors CLI: atomic HSL-based color palette generator and CSS module for scalable design systems.",
"version": "2025.5.13",
"description": "Style-Forge Colors: atomic HSL-based color palette generator and CSS module for scalable design systems.",
"type": "module",
"bin": {
"style-forge.colors": "./main.js"
"style-forge.colors": "./main.js",
"sf.colors": "./main.js"
},
"repository": {
"type": "git",
Expand All @@ -15,16 +16,16 @@
"keywords": [
"style-forge",
"colors",
"color palettes",
"color-palettes",
"theme",
"HSL",
"CSS generator",
"frontend",
"design system",
"atomic CSS",
"CLI",
"UI",
"web design"
"hsl",
"css-generator",
"frontend-development",
"design-system",
"atomic-css",
"cli",
"web-design",
"ui"
],
"dependencies": {
"chalk": "^5.4.1",
Expand Down