Skip to content

Commit 3e875fa

Browse files
committed
Update
1 parent 1d0728a commit 3e875fa

File tree

10 files changed

+800
-10
lines changed

10 files changed

+800
-10
lines changed

package-lock.json

Lines changed: 523 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"type": "commonjs",
1111
"main": "index.js",
1212
"scripts": {
13+
"build": "node tools/build.js",
1314
"test": "echo \"Error: no test specified\" && exit 1"
15+
},
16+
"devDependencies": {
17+
"sass": "^1.93.3"
1418
}
15-
}
19+
}

src/core/_colors.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Color Utilities
3+
// ========================================
4+
5+
@use "variables" as *;
6+
7+
@each $name, $color in $colors {
8+
.text-#{$name} {
9+
color: #{$color};
10+
}
11+
12+
.bg-#{$name} {
13+
background-color: #{$color};
14+
}
15+
16+
.border-#{$name} {
17+
border-color: #{$color};
18+
}
19+
}

src/core/_responsive.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Responsive System
3+
// ========================================
4+
5+
@use "variables" as *;
6+
7+
@each $screen, $width in $screens {
8+
@media (min-width: $width) {
9+
10+
// Example responsive utilities
11+
@each $size, $value in $font-sizes {
12+
.#{$screen}\:text-#{$size} {
13+
font-size: $value;
14+
}
15+
}
16+
17+
@each $name, $color in $colors {
18+
.#{$screen}\:text-#{$name} {
19+
color: $color;
20+
}
21+
}
22+
}
23+
}

src/core/_spacing.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Spacing Utilities
3+
// ========================================
4+
5+
@use "variables" as *;
6+
7+
@each $key, $val in $spacing {
8+
.m-#{$key} {
9+
margin: $val;
10+
}
11+
12+
.p-#{$key} {
13+
padding: $val;
14+
}
15+
16+
.mt-#{$key} {
17+
margin-top: $val;
18+
}
19+
20+
.mb-#{$key} {
21+
margin-bottom: $val;
22+
}
23+
24+
.pt-#{$key} {
25+
padding-top: $val;
26+
}
27+
28+
.pb-#{$key} {
29+
padding-bottom: $val;
30+
}
31+
}
32+
33+
.mx-auto {
34+
margin-left: auto;
35+
margin-right: auto;
36+
}

src/core/_typography.scss

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Typography
3+
// ========================================
4+
5+
@use "variables" as *;
6+
7+
body {
8+
font-family: "Inter", "Poppins", sans-serif;
9+
color: map-get($colors, "gray-700");
10+
line-height: 1.6;
11+
}
12+
13+
// Font sizes
14+
@each $size, $value in $font-sizes {
15+
.text-#{$size} {
16+
font-size: $value;
17+
}
18+
}
19+
20+
// Font weights
21+
$weights: (
22+
light: 300,
23+
normal: 400,
24+
medium: 500,
25+
bold: 700
26+
);
27+
28+
@each $name, $weight in $weights {
29+
.font-#{$name} {
30+
font-weight: $weight;
31+
}
32+
}
33+
34+
// Alignment
35+
.text-left {
36+
text-align: left;
37+
}
38+
39+
.text-center {
40+
text-align: center;
41+
}
42+
43+
.text-right {
44+
text-align: right;
45+
}

src/core/_utilities.scss

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Core Utilities
3+
// ========================================
4+
5+
@use "variables" as *;
6+
7+
/* Display */
8+
.block {
9+
display: block;
10+
}
11+
12+
.inline-block {
13+
display: inline-block;
14+
}
15+
16+
.flex {
17+
display: flex;
18+
}
19+
20+
.grid {
21+
display: grid;
22+
}
23+
24+
/* Flexbox helpers */
25+
.flex-row {
26+
flex-direction: row;
27+
}
28+
29+
.flex-col {
30+
flex-direction: column;
31+
}
32+
33+
.justify-center {
34+
justify-content: center;
35+
}
36+
37+
.items-center {
38+
align-items: center;
39+
}
40+
41+
/* Border radius */
42+
@each $name, $val in $radii {
43+
.rounded-#{$name} {
44+
border-radius: $val;
45+
}
46+
}
47+
48+
/* Shadows */
49+
$shadows: (
50+
sm: 0 1px 2px rgba(0, 0, 0, 0.05),
51+
md: 0 4px 6px rgba(0, 0, 0, 0.1),
52+
lg: 0 10px 15px rgba(0, 0, 0, 0.15)
53+
);
54+
55+
@each $name, $val in $shadows {
56+
.shadow-#{$name} {
57+
box-shadow: $val;
58+
}
59+
}
60+
61+
/* Width & height */
62+
.w-full {
63+
width: 100%;
64+
}
65+
66+
.h-full {
67+
height: 100%;
68+
}
69+
70+
/* Cursor */
71+
.cursor-pointer {
72+
cursor: pointer;
73+
}

src/core/_variables.scss

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// ========================================
2+
// JKCSS 7.0.0 – Variables
3+
// ========================================
4+
5+
// Color map
6+
$colors: (
7+
"red-500": #ef4444,
8+
"blue-500": #3b82f6,
9+
"green-500": #22c55e,
10+
"gray-700": #374151,
11+
"yellow-400": #facc15
12+
);
13+
14+
// Font sizes
15+
$font-sizes: (
16+
"sm": 0.875rem,
17+
"base": 1rem,
18+
"lg": 1.125rem,
19+
"xl": 1.25rem,
20+
"2xl": 1.5rem
21+
);
22+
23+
// Spacing scale
24+
$spacing: (
25+
1: 0.25rem,
26+
2: 0.5rem,
27+
3: 0.75rem,
28+
4: 1rem,
29+
5: 1.25rem
30+
);
31+
32+
// Border radius
33+
$radii: (
34+
sm: 4px,
35+
md: 8px,
36+
lg: 16px
37+
);
38+
39+
// Breakpoints
40+
$screens: (
41+
sm: 640px,
42+
md: 768px,
43+
lg: 1024px,
44+
xl: 1280px,
45+
"2xl": 1536px
46+
);

src/jkcss.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// JKCSS 7.0.0 Master Import
2+
@use "./core/variables";
3+
@use "./core/colors";
4+
@use "./core/typography";
5+
@use "./core/spacing";
6+
@use "./core/responsive";
7+
@use "./core/utilities";

tools/build.js

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1-
import { execSync } from "child_process";
2-
import fs from "fs";
1+
const { execSync } = require("child_process");
2+
const fs = require("fs");
33

44
console.log("🧩 Building JKCSS 7.0.0...");
55

6-
// Ensure dist exists
7-
if (!fs.existsSync("dist")) fs.mkdirSync("dist");
6+
// Ensure dist directory exists
7+
if (!fs.existsSync("dist")) fs.mkdirSync("dist", { recursive: true });
88

9-
// Build normal (expanded) version
10-
execSync("sass src/jkcss.scss dist/jkcss.css --no-source-map --style=expanded", { stdio: "inherit" });
9+
// Helper function to safely run commands
10+
function run(command) {
11+
try {
12+
execSync(command, { stdio: "inherit" });
13+
} catch (err) {
14+
console.error("❌ Build failed!");
15+
console.error(err.message);
16+
process.exit(1);
17+
}
18+
}
1119

12-
// Build minified version
13-
execSync("sass src/jkcss.scss dist/jkcss.min.css --no-source-map --style=compressed", { stdio: "inherit" });
20+
// Detect sass command: try local (npx) first, fallback to global
21+
const sassCmd = "npx sass";
1422

15-
console.log("✅ Build complete!");
23+
console.log("⚙️ Compiling expanded version...");
24+
run(`${sassCmd} src/jkcss.scss dist/jkcss.css --no-source-map --style=expanded`);
25+
26+
console.log("⚙️ Compiling minified version...");
27+
run(`${sassCmd} src/jkcss.scss dist/jkcss.min.css --no-source-map --style=compressed`);
28+
29+
console.log("\n✅ Build complete!");
1630
console.log("📦 Generated: dist/jkcss.css");
1731
console.log("📦 Generated: dist/jkcss.min.css");

0 commit comments

Comments
 (0)