@nemigo/tailwind 1.0.1 → 2.0.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) => Number.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 (!Number.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.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import plugin from "tailwindcss/plugin";
2
2
  const getConfigScreens = (cfg) => {
3
- const theme = cfg["theme"];
3
+ const theme = cfg.theme;
4
4
  if (!theme)
5
5
  return null;
6
- const screens = theme["screens"];
6
+ const screens = theme.screens;
7
7
  if (!screens)
8
8
  return null;
9
9
  const medias = Object.values(screens).filter((v) => typeof v === "string");
@@ -17,7 +17,7 @@ const getConfigScreens = (cfg) => {
17
17
  const diff = max - min;
18
18
  return { min, max, diff };
19
19
  };
20
- const manual = (v) => isNaN(Number(v));
20
+ const manual = (v) => Number.isNaN(Number(v));
21
21
  const unit = (v, unit) => (manual(v) ? v : v + unit);
22
22
  const main = plugin((api) => {
23
23
  const screens = getConfigScreens(api.config());
package/package.json CHANGED
@@ -1,22 +1,27 @@
1
1
  {
2
2
  "name": "@nemigo/tailwind",
3
- "version": "1.0.1",
3
+ "version": "2.0.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
- },
13
10
  "scripts": {
14
11
  "build": "svelte-package && rimraf .svelte-kit",
15
12
  "check": "tsc --noemit",
16
- "lint": "eslint ./",
17
- "format": "prettier --write ./"
13
+ "eslint": "eslint ./",
14
+ "eslint:fix": "eslint --fix ./",
15
+ "lint": "biome lint",
16
+ "lint:fix": "biome lint --fix --unsafe",
17
+ "lint:fix:unsafe": "biome lint --fix --unsafe",
18
+ "format": "biome check --write --linter-enabled=false"
18
19
  },
19
20
  "exports": {
21
+ "./extra": {
22
+ "types": "./dist/extra.d.ts",
23
+ "default": "./dist/extra.js"
24
+ },
20
25
  "./fluid": {
21
26
  "types": "./dist/fluid.d.ts",
22
27
  "default": "./dist/fluid.js"
@@ -26,7 +31,6 @@
26
31
  "tailwindcss": ">=4.0.0"
27
32
  },
28
33
  "devDependencies": {
29
- "@nemigo/configs": "workspace:*",
30
- "tailwindcss": "4.1.14"
34
+ "@nemigo/configs": "2.0.0"
31
35
  }
32
36
  }