@nemigo/tailwind 1.0.1 → 1.5.0
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/dist/extra.d.ts +4 -0
- package/dist/extra.js +146 -0
- package/package.json +6 -3
package/dist/extra.d.ts
ADDED
package/dist/extra.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import plugin from "tailwindcss/plugin";
|
|
2
|
+
const manual = (v) => isNaN(Number(v));
|
|
3
|
+
const unit = (v, unit, util) => {
|
|
4
|
+
if (manual(v))
|
|
5
|
+
return v;
|
|
6
|
+
if (v.startsWith("0."))
|
|
7
|
+
console.warn("Tailwind-Extra:", `Use ${util}-[${v.slice(1)}] instead ${util}-[${v}]`);
|
|
8
|
+
return v + unit;
|
|
9
|
+
};
|
|
10
|
+
const main = plugin((api) => {
|
|
11
|
+
const hover = "@media (hover:hover) { &:hover:not(:disabled):not(.disabled) }";
|
|
12
|
+
const active = "&:active";
|
|
13
|
+
const focusVisible = "&:focus-visible";
|
|
14
|
+
const focusWithin = "&:focus-within";
|
|
15
|
+
api.addVariant("h", [hover]);
|
|
16
|
+
api.addVariant("a", [active]);
|
|
17
|
+
api.addVariant("ha", [hover, active]);
|
|
18
|
+
api.addVariant("fv", [focusVisible]);
|
|
19
|
+
api.addVariant("hfv", [hover, focusVisible]);
|
|
20
|
+
api.addVariant("hfva", [hover, focusVisible, active]);
|
|
21
|
+
api.addVariant("fw", [focusWithin]);
|
|
22
|
+
api.addVariant("hfw", [hover, focusWithin]);
|
|
23
|
+
api.addVariant("hfwa", [hover, focusWithin, active]);
|
|
24
|
+
api.addUtilities({
|
|
25
|
+
".animation-reverse": { animationDirection: "reverse!important" },
|
|
26
|
+
".no-scroll": {
|
|
27
|
+
scrollbarWidth: "none!important",
|
|
28
|
+
"&::-webkit-scrollbar": {
|
|
29
|
+
display: "none!important",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
".fvn": {
|
|
33
|
+
"&:focus-visible": {
|
|
34
|
+
outline: "none",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
".svgo": {
|
|
38
|
+
"&:focus-visible": {
|
|
39
|
+
outline: "none",
|
|
40
|
+
},
|
|
41
|
+
"& .vector": {
|
|
42
|
+
vectorEffect: "non-scaling-stroke",
|
|
43
|
+
stroke: "#0000",
|
|
44
|
+
strokeWidth: "var(--focus-width)",
|
|
45
|
+
strokeLinejoin: "round",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
transition: "stroke var(--theme-duration) var(--theme-timing)",
|
|
48
|
+
},
|
|
49
|
+
"&:focus-visible .vector": {
|
|
50
|
+
stroke: "var(--color-focus)",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
".usn": { userSelect: "none" },
|
|
54
|
+
".ust": { userSelect: "text" },
|
|
55
|
+
".usa": { userSelect: "all" },
|
|
56
|
+
".pen": { pointerEvents: "none" },
|
|
57
|
+
".pea": { pointerEvents: "auto" },
|
|
58
|
+
".em": { fontSize: "1em" },
|
|
59
|
+
".rem": { fontSize: "1rem" },
|
|
60
|
+
".family-inter": { fontFamily: '"Inter", "Calibri", sans-serif !important' },
|
|
61
|
+
".family-calibri": { fontFamily: '"Calibri", "Inter", sans-serif !important' },
|
|
62
|
+
".brn": { whiteSpace: "pre-line" },
|
|
63
|
+
".t-full": { whiteSpace: "nowrap" },
|
|
64
|
+
".t-auto": { textWrap: "balance" },
|
|
65
|
+
".t-cut": {
|
|
66
|
+
overflowX: "hidden",
|
|
67
|
+
textOverflow: "ellipsis",
|
|
68
|
+
whiteSpace: "nowrap",
|
|
69
|
+
},
|
|
70
|
+
".vrl": { writingMode: "vertical-rl" },
|
|
71
|
+
".rtl": { direction: "rtl" },
|
|
72
|
+
".full": { width: "100%", height: "100%" },
|
|
73
|
+
".max-full": { maxWidth: "100%", maxHeight: "100%" },
|
|
74
|
+
".screen": { width: "100vw", height: "100svh" },
|
|
75
|
+
".max-screen": { maxWidth: "100vw", maxHeight: "100svh" },
|
|
76
|
+
".column": { display: "flex", flexDirection: "column" },
|
|
77
|
+
".column-reverse": { display: "flex", flexDirection: "column-reverse" },
|
|
78
|
+
".row": { flexDirection: "row" },
|
|
79
|
+
".row-reverse": { flexDirection: "row-reverse" },
|
|
80
|
+
".wrap": { flexWrap: "wrap" },
|
|
81
|
+
".fc": { display: "flex", alignItems: "center" },
|
|
82
|
+
".fcc": { display: "flex", alignItems: "center", justifyContent: "center" },
|
|
83
|
+
".fccc": { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" },
|
|
84
|
+
".fsb": { display: "flex", justifyContent: "space-between" },
|
|
85
|
+
".fsbc": { display: "flex", justifyContent: "space-between", alignItems: "center" },
|
|
86
|
+
".g-start": { justifyContent: "flex-start" },
|
|
87
|
+
".g-center": { justifyContent: "center" },
|
|
88
|
+
".g-end": { justifyContent: "flex-end" },
|
|
89
|
+
".g-sa": { justifyContent: "space-around" },
|
|
90
|
+
".g-sb": { justifyContent: "space-between" },
|
|
91
|
+
".g-se": { justifyContent: "space-evenly" },
|
|
92
|
+
".v-start": { alignItems: "flex-start" },
|
|
93
|
+
".v-center": { alignItems: "center" },
|
|
94
|
+
".v-end": { alignItems: "flex-end" },
|
|
95
|
+
".v-stretch": { alignItems: "stretch" },
|
|
96
|
+
".v-baseline": { alignItems: "baseline" },
|
|
97
|
+
".s-start": { alignSelf: "flex-start" },
|
|
98
|
+
".s-center": { alignSelf: "center" },
|
|
99
|
+
".s-end": { alignSelf: "flex-end" },
|
|
100
|
+
".s-stretch": { alignSelf: "stretch" },
|
|
101
|
+
".s-baseline": { alignSelf: "baseline" },
|
|
102
|
+
".fluid": {
|
|
103
|
+
minHeight: "0",
|
|
104
|
+
minWidth: "0",
|
|
105
|
+
flexShrink: "1",
|
|
106
|
+
flexGrow: "1",
|
|
107
|
+
},
|
|
108
|
+
".rigid": {
|
|
109
|
+
flexShrink: "0",
|
|
110
|
+
flexGrow: "0",
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
api.matchUtilities({
|
|
114
|
+
lh: (v) => ({ lineHeight: unit(v, "%", "lh") }),
|
|
115
|
+
fs: (v) => ({ fontSize: unit(v, "em", "fs") }),
|
|
116
|
+
br: (v) => ({ borderRadius: unit(v, "em", "br") }),
|
|
117
|
+
"br-t": (v) => ({ borderTopRadius: unit(v, "em", "br") }),
|
|
118
|
+
"br-b": (v) => ({ borderBottomRadius: unit(v, "em", "br") }),
|
|
119
|
+
"br-l": (v) => ({ borderLeftRadius: unit(v, "em", "br") }),
|
|
120
|
+
"br-r": (v) => ({ borderRightRadius: unit(v, "em", "br") }),
|
|
121
|
+
t: (v) => {
|
|
122
|
+
const duration = Number(v);
|
|
123
|
+
if (!isNaN(duration)) {
|
|
124
|
+
if (v.startsWith("0."))
|
|
125
|
+
console.warn("Tailwind-Extra:", `Use t-[${v.slice(1)}] instead t-[${v}]`);
|
|
126
|
+
return {
|
|
127
|
+
transitionDuration: `${duration}s !important`,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (v.includes(",")) {
|
|
131
|
+
const sorted = v.split(",").sort().join();
|
|
132
|
+
if (sorted !== v)
|
|
133
|
+
console.warn("Tailwind-Extra:", `Use t-[${sorted}] instead t-[${v}]`);
|
|
134
|
+
return {
|
|
135
|
+
transitionProperty: sorted,
|
|
136
|
+
transitionDuration: "var(--theme-duration)",
|
|
137
|
+
transitionTimingFunction: "var(--theme-timing)",
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
transition: `${v} var(--theme-duration) var(--theme-timing)`,
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
export default main;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nemigo/tailwind",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Vlad Logvin",
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"format": "prettier --write ./"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
|
+
"./extra": {
|
|
21
|
+
"types": "./dist/extra.d.ts",
|
|
22
|
+
"default": "./dist/extra.js"
|
|
23
|
+
},
|
|
20
24
|
"./fluid": {
|
|
21
25
|
"types": "./dist/fluid.d.ts",
|
|
22
26
|
"default": "./dist/fluid.js"
|
|
@@ -26,7 +30,6 @@
|
|
|
26
30
|
"tailwindcss": ">=4.0.0"
|
|
27
31
|
},
|
|
28
32
|
"devDependencies": {
|
|
29
|
-
"@nemigo/configs": "workspace:*"
|
|
30
|
-
"tailwindcss": "4.1.14"
|
|
33
|
+
"@nemigo/configs": "workspace:*"
|
|
31
34
|
}
|
|
32
35
|
}
|