@nemigo/tailwind 0.0.2 → 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.
@@ -0,0 +1,4 @@
1
+ import plugin from "tailwindcss/plugin";
2
+ export type Plugin = ReturnType<typeof plugin>;
3
+ declare const main: Plugin;
4
+ export default main;
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/dist/fluid.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import plugin from "tailwindcss/plugin";
2
- type Plugin = ReturnType<typeof plugin>;
2
+ export type Plugin = ReturnType<typeof plugin>;
3
3
  declare const main: Plugin;
4
+ /**
5
+ * @type {Plugin}
6
+ */
4
7
  export default main;
package/dist/fluid.js CHANGED
@@ -30,11 +30,11 @@ const main = plugin((api) => {
30
30
  const [_min, _max] = v.split("~");
31
31
  if (_min.startsWith("0.") || _max.startsWith("0.")) {
32
32
  if (!_max.startsWith("0."))
33
- console.warn("Tailwind:", `Use ${util}-[${_min.slice(1)}~${_max}] instead ${util}-[${v}]`);
33
+ console.warn("Tailwind-Fluid:", `Use ${util}-[${_min.slice(1)}~${_max}] instead ${util}-[${v}]`);
34
34
  else if (!_min.startsWith("0."))
35
- console.warn("Tailwind:", `Use ${util}-[${_min}~${_max.slice(1)}] instead ${util}-[${v}]`);
35
+ console.warn("Tailwind-Fluid:", `Use ${util}-[${_min}~${_max.slice(1)}] instead ${util}-[${v}]`);
36
36
  else
37
- console.warn("Tailwind:", `Use ${util}-[${_min.slice(1)}~${_max.slice(1)}] instead ${util}-[${v}]`);
37
+ console.warn("Tailwind-Fluid:", `Use ${util}-[${_min.slice(1)}~${_max.slice(1)}] instead ${util}-[${v}]`);
38
38
  }
39
39
  const max = Number(_max) || 0;
40
40
  const min = Number(_min) || 0;
@@ -97,4 +97,7 @@ const main = plugin((api) => {
97
97
  ["v-tt-y", "translateY"],
98
98
  ]));
99
99
  });
100
+ /**
101
+ * @type {Plugin}
102
+ */
100
103
  export default main;
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@nemigo/tailwind",
3
- "version": "0.0.2",
3
+ "version": "1.5.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
7
7
  "email": "vlad.logvin84@gmail.com"
8
8
  },
9
9
  "type": "module",
10
+ "engines": {
11
+ "node": ">=22"
12
+ },
10
13
  "scripts": {
11
14
  "build": "svelte-package && rimraf .svelte-kit",
12
15
  "check": "tsc --noemit",
@@ -14,6 +17,10 @@
14
17
  "format": "prettier --write ./"
15
18
  },
16
19
  "exports": {
20
+ "./extra": {
21
+ "types": "./dist/extra.d.ts",
22
+ "default": "./dist/extra.js"
23
+ },
17
24
  "./fluid": {
18
25
  "types": "./dist/fluid.d.ts",
19
26
  "default": "./dist/fluid.js"
@@ -23,7 +30,6 @@
23
30
  "tailwindcss": ">=4.0.0"
24
31
  },
25
32
  "devDependencies": {
26
- "@nemigo/configs": "workspace:*",
27
- "tailwindcss": "4.1.14"
33
+ "@nemigo/configs": "workspace:*"
28
34
  }
29
35
  }