@brewcodex/chai-css 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.html +335 -0
- package/dist/website/docs.html +3588 -0
- package/package.json +12 -10
- package/dist/chaitailwind.esm.js +0 -135
- package/dist/chaitailwind.iife.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brewcodex/chai-css",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A lightweight utility-first CSS engine with shorthand class names and 16px base scale",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/chaitailwind.esm.js",
|
|
@@ -15,18 +15,20 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"dev": "vite",
|
|
18
|
-
"build": "vite build",
|
|
18
|
+
"build": "vite build && vite build --config vite.docs.config.js",
|
|
19
19
|
"preview": "vite preview",
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
"keywords": [
|
|
23
|
+
"css",
|
|
24
|
+
"utility-first",
|
|
25
|
+
"tailwind-alternative",
|
|
26
|
+
"css-engine",
|
|
27
|
+
"atomic-css",
|
|
28
|
+
"frontend",
|
|
29
|
+
"brewcodex",
|
|
30
|
+
"chai-css"
|
|
31
|
+
],
|
|
30
32
|
"license": "MIT",
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"vite": "^8.0.1"
|
package/dist/chaitailwind.esm.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
//#region src/utilities/typography.js
|
|
2
|
-
var e = {
|
|
3
|
-
text: "color",
|
|
4
|
-
fs: "fontSize",
|
|
5
|
-
align: "textAlign",
|
|
6
|
-
weight: "fontWeight",
|
|
7
|
-
leading: "lineHeight",
|
|
8
|
-
tracking: "letterSpacing",
|
|
9
|
-
decoration: "textDecorationLine",
|
|
10
|
-
family: "fontFamily",
|
|
11
|
-
transform: "textTransform",
|
|
12
|
-
style: "fontStyle"
|
|
13
|
-
}, t = { bg: "backgroundColor" }, n = {
|
|
14
|
-
p: "padding",
|
|
15
|
-
pt: "paddingBlockStart",
|
|
16
|
-
pb: "paddingBlockEnd",
|
|
17
|
-
pl: "paddingInlineStart",
|
|
18
|
-
pr: "paddingInlineEnd",
|
|
19
|
-
px: "paddingInline",
|
|
20
|
-
py: "paddingBlock",
|
|
21
|
-
m: "margin",
|
|
22
|
-
mt: "marginBlockStart",
|
|
23
|
-
mb: "marginBlockEnd",
|
|
24
|
-
ml: "marginInlineStart",
|
|
25
|
-
mr: "marginInlineEnd",
|
|
26
|
-
mx: "marginInline",
|
|
27
|
-
my: "marginBlock"
|
|
28
|
-
}, r = {
|
|
29
|
-
bw: "borderWidth",
|
|
30
|
-
bc: "borderColor",
|
|
31
|
-
bs: "borderStyle",
|
|
32
|
-
bb: "borderBottom",
|
|
33
|
-
rounded: "borderRadius",
|
|
34
|
-
"border-collapse": "borderCollapse"
|
|
35
|
-
}, i = {
|
|
36
|
-
display: "display",
|
|
37
|
-
visibility: "visibility",
|
|
38
|
-
"box-sizing": "boxSizing",
|
|
39
|
-
pos: "position",
|
|
40
|
-
top: "top",
|
|
41
|
-
right: "right",
|
|
42
|
-
bottom: "bottom",
|
|
43
|
-
left: "left",
|
|
44
|
-
z: "zIndex",
|
|
45
|
-
overflow: "overflow",
|
|
46
|
-
"overflow-x": "overflowX",
|
|
47
|
-
"overflow-y": "overflowY",
|
|
48
|
-
object: "objectFit",
|
|
49
|
-
cursor: "cursor",
|
|
50
|
-
transition: "transition"
|
|
51
|
-
}, a = {
|
|
52
|
-
w: "width",
|
|
53
|
-
h: "height",
|
|
54
|
-
"min-w": "minWidth",
|
|
55
|
-
"min-h": "minHeight",
|
|
56
|
-
"max-w": "maxWidth",
|
|
57
|
-
"max-h": "maxHeight"
|
|
58
|
-
}, o = {
|
|
59
|
-
"flex-row": ["flexDirection"],
|
|
60
|
-
"flex-col": ["flexDirection"],
|
|
61
|
-
wrap: ["flexWrap"],
|
|
62
|
-
justify: ["justifyContent"],
|
|
63
|
-
items: ["alignItems"],
|
|
64
|
-
self: ["alignSelf"],
|
|
65
|
-
flex: ["flex"],
|
|
66
|
-
grow: ["flexGrow"],
|
|
67
|
-
shrink: ["flexShrink"],
|
|
68
|
-
gap: ["gap"]
|
|
69
|
-
}, s = {
|
|
70
|
-
...i,
|
|
71
|
-
...n,
|
|
72
|
-
...a,
|
|
73
|
-
...e,
|
|
74
|
-
...t,
|
|
75
|
-
...r,
|
|
76
|
-
...o
|
|
77
|
-
}, c = (e) => {
|
|
78
|
-
let t = e.replace("chai-", "").split("-"), n = `${t[0]}-${t[1]}`;
|
|
79
|
-
return console.log("Two parts:", n), s[n] ? {
|
|
80
|
-
propKey: n,
|
|
81
|
-
propValue: t.slice(2).join("-") || t[1]
|
|
82
|
-
} : s[t[0]] ? {
|
|
83
|
-
propKey: t[0],
|
|
84
|
-
propValue: t.slice(1).join("-")
|
|
85
|
-
} : {
|
|
86
|
-
propKey: null,
|
|
87
|
-
propValue: null
|
|
88
|
-
};
|
|
89
|
-
}, l = (e) => typeof e == "string" ? e.replace(/[\[\]]/g, "") : e, u = (e, t = 16) => {
|
|
90
|
-
let n = parseFloat(e);
|
|
91
|
-
return isNaN(n) ? e : `${n / t}rem`;
|
|
92
|
-
}, d = (e) => e.endsWith("vh") || e.endsWith("vw"), f = (e) => typeof e == "string" && e.endsWith("p"), p = (e) => e.replace("p", "%"), m = (e) => e.startsWith("#") || e.startsWith("[#") && e.endsWith("]"), h = (e) => typeof e == "string" && e.startsWith("[") && e.endsWith("]"), g = (e) => [
|
|
93
|
-
"p",
|
|
94
|
-
"m",
|
|
95
|
-
"fs",
|
|
96
|
-
"rounded",
|
|
97
|
-
"gap",
|
|
98
|
-
"w",
|
|
99
|
-
"h",
|
|
100
|
-
"min-w",
|
|
101
|
-
"min-h",
|
|
102
|
-
"max-w",
|
|
103
|
-
"max-h",
|
|
104
|
-
"pt",
|
|
105
|
-
"pb",
|
|
106
|
-
"pl",
|
|
107
|
-
"pr",
|
|
108
|
-
"px",
|
|
109
|
-
"py",
|
|
110
|
-
"mt",
|
|
111
|
-
"mb",
|
|
112
|
-
"ml",
|
|
113
|
-
"mr",
|
|
114
|
-
"mx",
|
|
115
|
-
"my",
|
|
116
|
-
"bw"
|
|
117
|
-
].includes(e), _ = (e, t) => e ? m(e) ? l(e) : f(e) ? p(e) : d(e) ? e : t === "flex-row" ? e === "reverse" ? "row-reverse" : "row" : t === "flex-col" ? (e === "column" || e === "col" || e === "reverse") && e === "reverse" ? "column-reverse" : "column" : !isNaN(e) && g(t) ? u(e) : h(e) ? l(e) : e : "", v = (e, t, n) => {
|
|
118
|
-
let r = s[t];
|
|
119
|
-
if (r) {
|
|
120
|
-
let i = _(n, t);
|
|
121
|
-
(Array.isArray(r) ? r : [r]).forEach((t) => {
|
|
122
|
-
e.style[t] = i;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, y = { init() {
|
|
126
|
-
document.querySelectorAll("[class*=\"chai-\"]").forEach((e) => {
|
|
127
|
-
[...e.classList].filter((e) => e.startsWith("chai-")).forEach((t) => {
|
|
128
|
-
let { propKey: n, propValue: r } = c(t);
|
|
129
|
-
n && (v(e, n, r), e.classList.remove(t));
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
} }, b = y;
|
|
133
|
-
typeof window < "u" && (document.readyState === "loading" ? window.addEventListener("DOMContentLoaded", () => y.init()) : y.init());
|
|
134
|
-
//#endregion
|
|
135
|
-
export { b as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ChaiTailwind=(function(){var e={text:`color`,fs:`fontSize`,align:`textAlign`,weight:`fontWeight`,leading:`lineHeight`,tracking:`letterSpacing`,decoration:`textDecorationLine`,family:`fontFamily`,transform:`textTransform`,style:`fontStyle`},t={bg:`backgroundColor`},n={p:`padding`,pt:`paddingBlockStart`,pb:`paddingBlockEnd`,pl:`paddingInlineStart`,pr:`paddingInlineEnd`,px:`paddingInline`,py:`paddingBlock`,m:`margin`,mt:`marginBlockStart`,mb:`marginBlockEnd`,ml:`marginInlineStart`,mr:`marginInlineEnd`,mx:`marginInline`,my:`marginBlock`},r={bw:`borderWidth`,bc:`borderColor`,bs:`borderStyle`,bb:`borderBottom`,rounded:`borderRadius`,"border-collapse":`borderCollapse`},i={display:`display`,visibility:`visibility`,"box-sizing":`boxSizing`,pos:`position`,top:`top`,right:`right`,bottom:`bottom`,left:`left`,z:`zIndex`,overflow:`overflow`,"overflow-x":`overflowX`,"overflow-y":`overflowY`,object:`objectFit`,cursor:`cursor`,transition:`transition`},a={w:`width`,h:`height`,"min-w":`minWidth`,"min-h":`minHeight`,"max-w":`maxWidth`,"max-h":`maxHeight`},o={"flex-row":[`flexDirection`],"flex-col":[`flexDirection`],wrap:[`flexWrap`],justify:[`justifyContent`],items:[`alignItems`],self:[`alignSelf`],flex:[`flex`],grow:[`flexGrow`],shrink:[`flexShrink`],gap:[`gap`]},s={...i,...n,...a,...e,...t,...r,...o},c=e=>{let t=e.replace(`chai-`,``).split(`-`),n=`${t[0]}-${t[1]}`;return console.log(`Two parts:`,n),s[n]?{propKey:n,propValue:t.slice(2).join(`-`)||t[1]}:s[t[0]]?{propKey:t[0],propValue:t.slice(1).join(`-`)}:{propKey:null,propValue:null}},l=e=>typeof e==`string`?e.replace(/[\[\]]/g,``):e,u=(e,t=16)=>{let n=parseFloat(e);return isNaN(n)?e:`${n/t}rem`},d=e=>e.endsWith(`vh`)||e.endsWith(`vw`),f=e=>typeof e==`string`&&e.endsWith(`p`),p=e=>e.replace(`p`,`%`),m=e=>e.startsWith(`#`)||e.startsWith(`[#`)&&e.endsWith(`]`),h=e=>typeof e==`string`&&e.startsWith(`[`)&&e.endsWith(`]`),g=e=>[`p`,`m`,`fs`,`rounded`,`gap`,`w`,`h`,`min-w`,`min-h`,`max-w`,`max-h`,`pt`,`pb`,`pl`,`pr`,`px`,`py`,`mt`,`mb`,`ml`,`mr`,`mx`,`my`,`bw`].includes(e),_=(e,t)=>e?m(e)?l(e):f(e)?p(e):d(e)?e:t===`flex-row`?e===`reverse`?`row-reverse`:`row`:t===`flex-col`?(e===`column`||e===`col`||e===`reverse`)&&e===`reverse`?`column-reverse`:`column`:!isNaN(e)&&g(t)?u(e):h(e)?l(e):e:``,v=(e,t,n)=>{let r=s[t];if(r){let i=_(n,t);(Array.isArray(r)?r:[r]).forEach(t=>{e.style[t]=i})}},y={init(){document.querySelectorAll(`[class*="chai-"]`).forEach(e=>{[...e.classList].filter(e=>e.startsWith(`chai-`)).forEach(t=>{let{propKey:n,propValue:r}=c(t);n&&(v(e,n,r),e.classList.remove(t))})})}},b=y;return typeof window<`u`&&(document.readyState===`loading`?window.addEventListener(`DOMContentLoaded`,()=>y.init()):y.init()),b})();
|