@nauverse/tailwind-dot-grid-backgrounds 1.2.7 → 1.2.13

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { PluginCreator } from 'tailwindcss/types/config';
3
3
 
4
4
  declare const tailwindDotGridBackgrounds: {
5
5
  handler: PluginCreator;
6
- config?: Partial<Config> | undefined;
6
+ config?: Partial<Config>;
7
7
  };
8
8
  export default tailwindDotGridBackgrounds;
9
9
 
@@ -1,6 +1,25 @@
1
- function f(t) {
1
+ function d(t) {
2
2
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
3
  }
4
+ var f = {};
5
+ (function(t) {
6
+ Object.defineProperty(t, "__esModule", {
7
+ value: !0
8
+ }), Object.defineProperty(t, "default", {
9
+ enumerable: !0,
10
+ get: function() {
11
+ return o;
12
+ }
13
+ });
14
+ const u = (r) => Object.assign({}, ...Object.entries(r ?? {}).flatMap(([n, e]) => typeof e == "object" ? Object.entries(u(e)).map(([a, i]) => ({
15
+ [n + (a === "DEFAULT" ? "" : `-${a}`)]: i
16
+ })) : [
17
+ {
18
+ [`${n}`]: e
19
+ }
20
+ ])), o = u;
21
+ })(f);
22
+ const _ = /* @__PURE__ */ d(f);
4
23
  var s = {}, p = {};
5
24
  (function(t) {
6
25
  Object.defineProperty(t, "__esModule", {
@@ -11,23 +30,23 @@ var s = {}, p = {};
11
30
  return o;
12
31
  }
13
32
  });
14
- function a(r, n) {
33
+ function u(r, n) {
15
34
  return {
16
35
  handler: r,
17
36
  config: n
18
37
  };
19
38
  }
20
- a.withOptions = function(r, n = () => ({})) {
21
- const e = function(u) {
39
+ u.withOptions = function(r, n = () => ({})) {
40
+ const e = function(a) {
22
41
  return {
23
- __options: u,
24
- handler: r(u),
25
- config: n(u)
42
+ __options: a,
43
+ handler: r(a),
44
+ config: n(a)
26
45
  };
27
46
  };
28
47
  return e.__isOptionsFunction = !0, e.__pluginFunction = r, e.__configFunction = n, e;
29
48
  };
30
- const o = a;
49
+ const o = u;
31
50
  })(p);
32
51
  (function(t) {
33
52
  Object.defineProperty(t, "__esModule", {
@@ -38,64 +57,45 @@ var s = {}, p = {};
38
57
  return r;
39
58
  }
40
59
  });
41
- const a = /* @__PURE__ */ o(p);
60
+ const u = /* @__PURE__ */ o(p);
42
61
  function o(n) {
43
62
  return n && n.__esModule ? n : {
44
63
  default: n
45
64
  };
46
65
  }
47
- const r = a.default;
66
+ const r = u.default;
48
67
  })(s);
49
- let i = s;
50
- var _ = (i.__esModule ? i : { default: i }).default;
51
- const g = /* @__PURE__ */ f(_);
52
- var d = {};
53
- (function(t) {
54
- Object.defineProperty(t, "__esModule", {
55
- value: !0
56
- }), Object.defineProperty(t, "default", {
57
- enumerable: !0,
58
- get: function() {
59
- return o;
60
- }
61
- });
62
- const a = (r) => Object.assign({}, ...Object.entries(r ?? {}).flatMap(([n, e]) => typeof e == "object" ? Object.entries(a(e)).map(([u, c]) => ({
63
- [n + (u === "DEFAULT" ? "" : `-${u}`)]: c
64
- })) : [
65
- {
66
- [`${n}`]: e
67
- }
68
- ])), o = a;
69
- })(d);
70
- const $ = /* @__PURE__ */ f(d), P = 16, O = g(function({
71
- matchUtilities: t,
72
- theme: a
73
- }) {
74
- const o = $(a("backgroundColor")), r = ["1", ...Object.keys(a("borderWidth"))], n = Object.entries(a("width")).filter(([, e]) => e.endsWith("rem")).map(([e, u]) => [
75
- e,
76
- parseFloat(u.replace("rem", "")) * P
77
- ]);
78
- r.forEach((e) => {
79
- n.forEach(([u, c]) => {
80
- t(
81
- {
82
- // This key is for the square grid background
83
- [`bg-grid-${u}-s-${e}`]: (l) => ({
84
- backgroundImage: `linear-gradient(to right, ${l} ${e}px, transparent ${e}px),linear-gradient(to bottom, ${l} ${e}px, transparent ${e}px)`,
85
- backgroundSize: `${c}px ${c}px`
86
- }),
87
- // And this key is for the dotted background
88
- [`bg-dot-${u}-s-${e}`]: (l) => ({
89
- backgroundImage: `radial-gradient(${l} ${e}px, transparent ${e}px)`,
90
- backgroundSize: `${c}px ${c}px`
91
- })
92
- },
93
- { values: o, type: "color" }
94
- );
95
- });
96
- });
97
- });
68
+ let c = s;
69
+ var g = (c.__esModule ? c : { default: c }).default;
70
+ const b = /* @__PURE__ */ d(g), $ = 16, P = b(
71
+ ({
72
+ matchUtilities: t,
73
+ theme: u
74
+ }) => {
75
+ const o = _(u("backgroundColor")), r = ["1", ...Object.keys(u("borderWidth"))], n = Object.entries(u("width")).filter(([, e]) => e.endsWith("rem")).map(([e, a]) => [
76
+ e,
77
+ Number.parseFloat(a.replace("rem", "")) * $
78
+ ]);
79
+ for (const e of r)
80
+ for (const [a, i] of n)
81
+ t(
82
+ {
83
+ // This key is for the square grid background
84
+ [`bg-grid-${a}-s-${e}`]: (l) => ({
85
+ backgroundImage: `linear-gradient(to right, ${l} ${e}px, transparent ${e}px),linear-gradient(to bottom, ${l} ${e}px, transparent ${e}px)`,
86
+ backgroundSize: `${i}px ${i}px`
87
+ }),
88
+ // And this key is for the dotted background
89
+ [`bg-dot-${a}-s-${e}`]: (l) => ({
90
+ backgroundImage: `radial-gradient(${l} ${e}px, transparent ${e}px)`,
91
+ backgroundSize: `${i}px ${i}px`
92
+ })
93
+ },
94
+ { values: o, type: "color" }
95
+ );
96
+ }
97
+ );
98
98
  export {
99
- O as default
99
+ P as default
100
100
  };
101
101
  //# sourceMappingURL=tailwind-dot-grid-backgrounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-dot-grid-backgrounds.js","sources":["../node_modules/tailwindcss/lib/util/createPlugin.js","../node_modules/tailwindcss/lib/public/create-plugin.js","../node_modules/tailwindcss/plugin.js","../node_modules/tailwindcss/lib/util/flattenColorPalette.js","../src/plugin.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == \"object\" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({\n [color + (number === \"DEFAULT\" ? \"\" : `-${number}`)]: hex\n })) : [\n {\n [`${color}`]: values\n }\n ]));\nconst _default = flattenColorPalette;\n","import plugin from \"tailwindcss/plugin\";\n// @ts-expect-error - flattenColorPalette file does not export a type declaration\nimport flattenColorPalette from \"tailwindcss/lib/util/flattenColorPalette\";\nimport type { PluginAPI } from \"tailwindcss/types/config\";\n\nconst REM_TO_PX = 16; // 1rem = 16px\n\nconst tailwindDotGridBackgrounds = plugin(function ({\n matchUtilities,\n theme\n}: {\n matchUtilities: PluginAPI[\"matchUtilities\"];\n theme: PluginAPI[\"theme\"];\n}) {\n // Obtain the color palette from the theme\n const colorPalette = flattenColorPalette(theme(\"backgroundColor\"));\n\n // The border widths from Tailwind CSS will be the values used for the grid stoke widths. We also add the value \"1\" to the list of border widths (since Tailwind CSS does not include it by default).\n const borderWidths = [\"1\", ...Object.keys(theme(\"borderWidth\"))];\n\n // For the sizes (the size of the squares in the grid or the distance between the dots in the dotted background), we will use the numeric width values from the \"width\" theme object. We will filter out the values that are not in \"rem\" units and convert the remaining values to pixels.\n const numericWidths: Array<[string, number]> = (\n Object.entries(theme(\"width\")) as Array<[string, string]>\n )\n .filter(([, value]) => value.endsWith(\"rem\"))\n .map(([key, value]) => [\n key,\n parseFloat(value.replace(\"rem\", \"\")) * REM_TO_PX\n ]);\n\n // Now iterate to generate all the utility classes\n borderWidths.forEach(borderWidth => {\n numericWidths.forEach(([widthKey, widthValue]) => {\n matchUtilities(\n {\n // This key is for the square grid background\n [`bg-grid-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n return {\n backgroundImage: `linear-gradient(to right, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px),linear-gradient(to bottom, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n backgroundSize: `${widthValue}px ${widthValue}px`\n };\n },\n // And this key is for the dotted background\n [`bg-dot-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n return {\n backgroundImage: `radial-gradient(${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n backgroundSize: `${widthValue}px ${widthValue}px`\n };\n }\n },\n { values: colorPalette, type: \"color\" }\n );\n });\n });\n});\n\nexport default tailwindDotGridBackgrounds;\n"],"names":["exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","_createPlugin","_interop_require_default","require$$0","obj","flattenColorPalette","colors","color","values","number","hex","REM_TO_PX","tailwindDotGridBackgrounds","matchUtilities","theme","colorPalette","borderWidths","numericWidths","value","key","borderWidth","widthKey","widthValue","colorValue"],"mappings":";;;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,GAAGE,CAAU,MAAMA,CAAU;AAAA,UAAA;AAAA;AAAA,UAIjD,CAAC,UAAUD,CAAQ,MAAMD,CAAW,EAAE,GAAG,CAACG,OACjC;AAAA,YACL,iBAAiB,mBAAmBA,CAAU,IAAIH,CAAW,mBAAmBA,CAAW;AAAA,YAC3F,gBAAgB,GAAGE,CAAU,MAAMA,CAAU;AAAA,UAAA;AAAA,QAGnD;AAAA,QACA,EAAE,QAAQP,GAAc,MAAM,QAAQ;AAAA,MAAA;AAAA,IACxC,CACD;AAAA,EAAA,CACF;AACH,CAAC;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"tailwind-dot-grid-backgrounds.js","sources":["../node_modules/tailwindcss/lib/util/flattenColorPalette.js","../node_modules/tailwindcss/lib/util/createPlugin.js","../node_modules/tailwindcss/lib/public/create-plugin.js","../node_modules/tailwindcss/plugin.js","../src/plugin.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == \"object\" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({\n [color + (number === \"DEFAULT\" ? \"\" : `-${number}`)]: hex\n })) : [\n {\n [`${color}`]: values\n }\n ]));\nconst _default = flattenColorPalette;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","// @ts-expect-error - flattenColorPalette file does not export a type declaration\nimport flattenColorPalette from \"tailwindcss/lib/util/flattenColorPalette\";\nimport plugin from \"tailwindcss/plugin\";\nimport type { PluginAPI } from \"tailwindcss/types/config\";\n\nconst REM_TO_PX = 16; // 1rem = 16px\n\nconst tailwindDotGridBackgrounds = plugin(\n\t({\n\t\tmatchUtilities,\n\t\ttheme,\n\t}: {\n\t\tmatchUtilities: PluginAPI[\"matchUtilities\"];\n\t\ttheme: PluginAPI[\"theme\"];\n\t}) => {\n\t\t// Obtain the color palette from the theme\n\t\tconst colorPalette = flattenColorPalette(theme(\"backgroundColor\"));\n\n\t\t// The border widths from Tailwind CSS will be the values used for the grid stoke widths. We also add the value \"1\" to the list of border widths (since Tailwind CSS does not include it by default).\n\t\tconst borderWidths = [\"1\", ...Object.keys(theme(\"borderWidth\"))];\n\n\t\t// For the sizes (the size of the squares in the grid or the distance between the dots in the dotted background), we will use the numeric width values from the \"width\" theme object. We will filter out the values that are not in \"rem\" units and convert the remaining values to pixels.\n\t\tconst numericWidths: Array<[string, number]> = (\n\t\t\tObject.entries(theme(\"width\")) as Array<[string, string]>\n\t\t)\n\t\t\t.filter(([, value]) => value.endsWith(\"rem\"))\n\t\t\t.map(([key, value]) => [\n\t\t\t\tkey,\n\t\t\t\tNumber.parseFloat(value.replace(\"rem\", \"\")) * REM_TO_PX,\n\t\t\t]);\n\n\t\t// Now iterate to generate all the utility classes\n\t\tfor (const borderWidth of borderWidths) {\n\t\t\tfor (const [widthKey, widthValue] of numericWidths) {\n\t\t\t\tmatchUtilities(\n\t\t\t\t\t{\n\t\t\t\t\t\t// This key is for the square grid background\n\t\t\t\t\t\t[`bg-grid-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbackgroundImage: `linear-gradient(to right, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px),linear-gradient(to bottom, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n\t\t\t\t\t\t\t\tbackgroundSize: `${widthValue}px ${widthValue}px`,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// And this key is for the dotted background\n\t\t\t\t\t\t[`bg-dot-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbackgroundImage: `radial-gradient(${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n\t\t\t\t\t\t\t\tbackgroundSize: `${widthValue}px ${widthValue}px`,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{ values: colorPalette, type: \"color\" },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t},\n);\n\nexport default tailwindDotGridBackgrounds;\n"],"names":["exports","_default","flattenColorPalette","colors","color","values","number","hex","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","_createPlugin","_interop_require_default","require$$0","obj","REM_TO_PX","tailwindDotGridBackgrounds","matchUtilities","theme","colorPalette","borderWidths","numericWidths","value","key","borderWidth","widthKey","widthValue","colorValue"],"mappings":";;;;;AACA,SAAO,eAAwBA,GAAA,cAAc;AAAA,IACzC,OAAO;AAAA,EACX,CAAC,GACD,OAAO,eAAeA,GAAS,WAAW;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AClC;AAAA,cACN,iBAAiB,mBAAmBA,CAAU,IAAIH,CAAW,mBAAmBA,CAAW;AAAA,cAC3F,gBAAgB,GAAGE,CAAU,MAAMA,CAAU;AAAA,YAAA;AAAA,UAGhD;AAAA,UACA,EAAE,QAAQP,GAAc,MAAM,QAAQ;AAAA,QAAA;AAAA,EAI1C;AACD;","x_google_ignoreList":[0,1,2,3]}
@@ -1,2 +1,2 @@
1
- (function(i,c){typeof exports=="object"&&typeof module<"u"?module.exports=c():typeof define=="function"&&define.amd?define(c):(i=typeof globalThis<"u"?globalThis:i||self,i["tailwind-dot-grid-backgrounds"]=c())})(this,function(){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var c={},s={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});function u(r,n){return{handler:r,config:n}}u.withOptions=function(r,n=()=>({})){const e=function(o){return{__options:o,handler:r(o),config:n(o)}};return e.__isOptionsFunction=!0,e.__pluginFunction=r,e.__configFunction=n,e};const a=u})(s),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const u=a(s);function a(n){return n&&n.__esModule?n:{default:n}}const r=u.default}(c);let d=c;var g=(d.__esModule?d:{default:d}).default;const _=i(g);var p={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const u=r=>Object.assign({},...Object.entries(r??{}).flatMap(([n,e])=>typeof e=="object"?Object.entries(u(e)).map(([o,l])=>({[n+(o==="DEFAULT"?"":`-${o}`)]:l})):[{[`${n}`]:e}])),a=u})(p);const $=i(p),b=16;return _(function({matchUtilities:t,theme:u}){const a=$(u("backgroundColor")),r=["1",...Object.keys(u("borderWidth"))],n=Object.entries(u("width")).filter(([,e])=>e.endsWith("rem")).map(([e,o])=>[e,parseFloat(o.replace("rem",""))*b]);r.forEach(e=>{n.forEach(([o,l])=>{t({[`bg-grid-${o}-s-${e}`]:f=>({backgroundImage:`linear-gradient(to right, ${f} ${e}px, transparent ${e}px),linear-gradient(to bottom, ${f} ${e}px, transparent ${e}px)`,backgroundSize:`${l}px ${l}px`}),[`bg-dot-${o}-s-${e}`]:f=>({backgroundImage:`radial-gradient(${f} ${e}px, transparent ${e}px)`,backgroundSize:`${l}px ${l}px`})},{values:a,type:"color"})})})})});
1
+ (function(a,d){typeof exports=="object"&&typeof module<"u"?module.exports=d():typeof define=="function"&&define.amd?define(d):(a=typeof globalThis<"u"?globalThis:a||self,a["tailwind-dot-grid-backgrounds"]=d())})(this,function(){"use strict";function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});const o=r=>Object.assign({},...Object.entries(r??{}).flatMap(([n,e])=>typeof e=="object"?Object.entries(o(e)).map(([u,l])=>({[n+(u==="DEFAULT"?"":`-${u}`)]:l})):[{[`${n}`]:e}])),i=o})(d);const g=a(d);var s={},p={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});function o(r,n){return{handler:r,config:n}}o.withOptions=function(r,n=()=>({})){const e=function(u){return{__options:u,handler:r(u),config:n(u)}};return e.__isOptionsFunction=!0,e.__pluginFunction=r,e.__configFunction=n,e};const i=o})(p),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const o=i(p);function i(n){return n&&n.__esModule?n:{default:n}}const r=o.default}(s);let f=s;var _=(f.__esModule?f:{default:f}).default;const b=a(_),$=16;return b(({matchUtilities:t,theme:o})=>{const i=g(o("backgroundColor")),r=["1",...Object.keys(o("borderWidth"))],n=Object.entries(o("width")).filter(([,e])=>e.endsWith("rem")).map(([e,u])=>[e,Number.parseFloat(u.replace("rem",""))*$]);for(const e of r)for(const[u,l]of n)t({[`bg-grid-${u}-s-${e}`]:c=>({backgroundImage:`linear-gradient(to right, ${c} ${e}px, transparent ${e}px),linear-gradient(to bottom, ${c} ${e}px, transparent ${e}px)`,backgroundSize:`${l}px ${l}px`}),[`bg-dot-${u}-s-${e}`]:c=>({backgroundImage:`radial-gradient(${c} ${e}px, transparent ${e}px)`,backgroundSize:`${l}px ${l}px`})},{values:i,type:"color"})})});
2
2
  //# sourceMappingURL=tailwind-dot-grid-backgrounds.umd.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-dot-grid-backgrounds.umd.cjs","sources":["../node_modules/tailwindcss/lib/util/createPlugin.js","../node_modules/tailwindcss/lib/public/create-plugin.js","../node_modules/tailwindcss/plugin.js","../node_modules/tailwindcss/lib/util/flattenColorPalette.js","../src/plugin.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == \"object\" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({\n [color + (number === \"DEFAULT\" ? \"\" : `-${number}`)]: hex\n })) : [\n {\n [`${color}`]: values\n }\n ]));\nconst _default = flattenColorPalette;\n","import plugin from \"tailwindcss/plugin\";\n// @ts-expect-error - flattenColorPalette file does not export a type declaration\nimport flattenColorPalette from \"tailwindcss/lib/util/flattenColorPalette\";\nimport type { PluginAPI } from \"tailwindcss/types/config\";\n\nconst REM_TO_PX = 16; // 1rem = 16px\n\nconst tailwindDotGridBackgrounds = plugin(function ({\n matchUtilities,\n theme\n}: {\n matchUtilities: PluginAPI[\"matchUtilities\"];\n theme: PluginAPI[\"theme\"];\n}) {\n // Obtain the color palette from the theme\n const colorPalette = flattenColorPalette(theme(\"backgroundColor\"));\n\n // The border widths from Tailwind CSS will be the values used for the grid stoke widths. We also add the value \"1\" to the list of border widths (since Tailwind CSS does not include it by default).\n const borderWidths = [\"1\", ...Object.keys(theme(\"borderWidth\"))];\n\n // For the sizes (the size of the squares in the grid or the distance between the dots in the dotted background), we will use the numeric width values from the \"width\" theme object. We will filter out the values that are not in \"rem\" units and convert the remaining values to pixels.\n const numericWidths: Array<[string, number]> = (\n Object.entries(theme(\"width\")) as Array<[string, string]>\n )\n .filter(([, value]) => value.endsWith(\"rem\"))\n .map(([key, value]) => [\n key,\n parseFloat(value.replace(\"rem\", \"\")) * REM_TO_PX\n ]);\n\n // Now iterate to generate all the utility classes\n borderWidths.forEach(borderWidth => {\n numericWidths.forEach(([widthKey, widthValue]) => {\n matchUtilities(\n {\n // This key is for the square grid background\n [`bg-grid-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n return {\n backgroundImage: `linear-gradient(to right, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px),linear-gradient(to bottom, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n backgroundSize: `${widthValue}px ${widthValue}px`\n };\n },\n // And this key is for the dotted background\n [`bg-dot-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n return {\n backgroundImage: `radial-gradient(${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n backgroundSize: `${widthValue}px ${widthValue}px`\n };\n }\n },\n { values: colorPalette, type: \"color\" }\n );\n });\n });\n});\n\nexport default tailwindDotGridBackgrounds;\n"],"names":["exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","_createPlugin","_interop_require_default","require$$0","obj","flattenColorPalette","colors","color","values","number","hex","REM_TO_PX","matchUtilities","theme","colorPalette","borderWidths","numericWidths","value","key","borderWidth","widthKey","widthValue","colorValue"],"mappings":"gXACA,OAAO,eAAwBA,EAAA,aAAc,CACzC,MAAO,EACX,CAAC,EACD,OAAO,eAAeA,EAAS,UAAW,CACtC,WAAY,GACZ,IAAK,UAAW,CACZ,OAAOC,CACV,CACL,CAAC,EACD,SAASC,EAAaC,EAAQC,EAAQ,CAClC,MAAO,CACH,QAASD,EACT,OAAAC,CACR,CACC,CACDF,EAAa,YAAc,SAASG,EAAgBC,EAAiB,KAAK,CAAE,GAAG,CAC3E,MAAMC,EAAkB,SAASC,EAAS,CACtC,MAAO,CACH,UAAWA,EACX,QAASH,EAAeG,CAAO,EAC/B,OAAQF,EAAeE,CAAO,CAC1C,CACA,EACI,OAAAD,EAAgB,oBAAsB,GAGtCA,EAAgB,iBAAmBF,EACnCE,EAAgB,iBAAmBD,EAC5BC,CACX,EACA,MAAMN,EAAWC,mBC9BjB,OAAO,eAAwBF,EAAA,aAAc,CACzC,MAAO,EACX,CAAC,EACD,OAAO,eAAeA,EAAS,UAAW,CACtC,WAAY,GACZ,I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,EAGHI,EAAa,QAAuBI,GAAA,CAClCH,EAAc,QAAQ,CAAC,CAACI,EAAUC,CAAU,IAAM,CAChDT,EACE,CAEE,CAAC,WAAWQ,CAAQ,MAAMD,CAAW,EAAE,EAAIG,IAClC,CACL,gBAAiB,6BAA6BA,CAAU,IAAIH,CAAW,mBAAmBA,CAAW,kCAAkCG,CAAU,IAAIH,CAAW,mBAAmBA,CAAW,MAC9L,eAAgB,GAAGE,CAAU,MAAMA,CAAU,IAAA,GAIjD,CAAC,UAAUD,CAAQ,MAAMD,CAAW,EAAE,EAAIG,IACjC,CACL,gBAAiB,mBAAmBA,CAAU,IAAIH,CAAW,mBAAmBA,CAAW,MAC3F,eAAgB,GAAGE,CAAU,MAAMA,CAAU,IAAA,EAGnD,EACA,CAAE,OAAQP,EAAc,KAAM,OAAQ,CAAA,CACxC,CACD,CAAA,CACF,CACH,CAAC","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"tailwind-dot-grid-backgrounds.umd.cjs","sources":["../node_modules/tailwindcss/lib/util/flattenColorPalette.js","../node_modules/tailwindcss/lib/util/createPlugin.js","../node_modules/tailwindcss/lib/public/create-plugin.js","../node_modules/tailwindcss/plugin.js","../src/plugin.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == \"object\" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({\n [color + (number === \"DEFAULT\" ? \"\" : `-${number}`)]: hex\n })) : [\n {\n [`${color}`]: values\n }\n ]));\nconst _default = flattenColorPalette;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","// @ts-expect-error - flattenColorPalette file does not export a type declaration\nimport flattenColorPalette from \"tailwindcss/lib/util/flattenColorPalette\";\nimport plugin from \"tailwindcss/plugin\";\nimport type { PluginAPI } from \"tailwindcss/types/config\";\n\nconst REM_TO_PX = 16; // 1rem = 16px\n\nconst tailwindDotGridBackgrounds = plugin(\n\t({\n\t\tmatchUtilities,\n\t\ttheme,\n\t}: {\n\t\tmatchUtilities: PluginAPI[\"matchUtilities\"];\n\t\ttheme: PluginAPI[\"theme\"];\n\t}) => {\n\t\t// Obtain the color palette from the theme\n\t\tconst colorPalette = flattenColorPalette(theme(\"backgroundColor\"));\n\n\t\t// The border widths from Tailwind CSS will be the values used for the grid stoke widths. We also add the value \"1\" to the list of border widths (since Tailwind CSS does not include it by default).\n\t\tconst borderWidths = [\"1\", ...Object.keys(theme(\"borderWidth\"))];\n\n\t\t// For the sizes (the size of the squares in the grid or the distance between the dots in the dotted background), we will use the numeric width values from the \"width\" theme object. We will filter out the values that are not in \"rem\" units and convert the remaining values to pixels.\n\t\tconst numericWidths: Array<[string, number]> = (\n\t\t\tObject.entries(theme(\"width\")) as Array<[string, string]>\n\t\t)\n\t\t\t.filter(([, value]) => value.endsWith(\"rem\"))\n\t\t\t.map(([key, value]) => [\n\t\t\t\tkey,\n\t\t\t\tNumber.parseFloat(value.replace(\"rem\", \"\")) * REM_TO_PX,\n\t\t\t]);\n\n\t\t// Now iterate to generate all the utility classes\n\t\tfor (const borderWidth of borderWidths) {\n\t\t\tfor (const [widthKey, widthValue] of numericWidths) {\n\t\t\t\tmatchUtilities(\n\t\t\t\t\t{\n\t\t\t\t\t\t// This key is for the square grid background\n\t\t\t\t\t\t[`bg-grid-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbackgroundImage: `linear-gradient(to right, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px),linear-gradient(to bottom, ${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n\t\t\t\t\t\t\t\tbackgroundSize: `${widthValue}px ${widthValue}px`,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// And this key is for the dotted background\n\t\t\t\t\t\t[`bg-dot-${widthKey}-s-${borderWidth}`]: (colorValue: string) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbackgroundImage: `radial-gradient(${colorValue} ${borderWidth}px, transparent ${borderWidth}px)`,\n\t\t\t\t\t\t\t\tbackgroundSize: `${widthValue}px ${widthValue}px`,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{ values: colorPalette, type: \"color\" },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t},\n);\n\nexport default tailwindDotGridBackgrounds;\n"],"names":["exports","_default","flattenColorPalette","colors","color","values","number","hex","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","_createPlugin","_interop_require_default","require$$0","obj","REM_TO_PX","matchUtilities","theme","colorPalette","borderWidths","numericWidths","value","key","borderWidth","widthKey","widthValue","colorValue"],"mappings":"2WACA,OAAO,eAAwBA,EAAA,aAAc,CACzC,MAAO,EACX,CAAC,EACD,OAAO,eAAeA,EAAS,UAAW,CACtC,WAAY,GACZ,IAAK,UAAW,CACZ,OAAOC,CACV,CACL,CAAC,EACD,MAAMC,EAAuBC,GAAS,OAAO,OAAO,CAAE,EAAE,GAAG,OAAO,QAAQA,GAAgD,EAAE,EAAE,QAAQ,CAAC,CAACC,EAAOC,CAAM,IAAI,OAAOA,GAAU,SAAW,OAAO,QAAQH,EAAoBG,CAAM,CAAC,EAAE,IAAI,CAAC,CAACC,EAAQC,CAAG,KAAK,CACvO,CAACH,GAASE,IAAW,UAAY,GAAK,IAAIA,CAAM,GAAG,EAAGC,CACzD,EAAC,EAAI,CACN,CACI,CAAC,GAAGH,CAAK,EAAE,EAAGC,CACjB,CACJ,CAAA,CAAC,EACJJ,EAAWC,+CChBjB,OAAO,eAAwBF,EAAA,aAAc,CACzC,MAAO,EACX,CAAC,EACD,OAAO,eAAeA,EAAS,UAAW,CACtC,WAAY,GACZ,IAAK,UAAW,CACZ,OAAOC,CACV,CACL,CAAC,EACD,SAASO,EAAaC,EAAQC,EAAQ,CAClC,MAAO,CACH,QAASD,EACT,OAAAC,CACR,CACC,CACDF,EAAa,YAAc,SAASG,EAAgBC,EAAiB,KAAK,CAAE,GAAG,CAC3E,MAAMC,EAAkB,SAASC,EAAS,CACtC,MAAO,CACH,UAAWA,EACX,QAASH,EAAeG,CAAO,EAC/B,OAAQF,EAAeE,CAAO,CAC1C,CACA,EACI,OAAAD,EAAgB,oBAAsB,GAGtCA,EAAgB,iBAAmBF,EACnCE,EAAgB,iBAAmBD,EAC5BC,CACX,EACA,MAAMZ,EAAWO,mBC9BjB,OAAO,eAAwBR,EAAA,aAAc,CACzC,MAAO,EACX,CAAC,EACD,OAAO,eAAeA,EAAS,UAAW,CACtC,WAAY,GACZ,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[0,1,2,3]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nauverse/tailwind-dot-grid-backgrounds",
3
3
  "description": "🎨 A tiny Tailwind plugin to add dot and grid customizable backgrounds fast",
4
4
  "author": {
5
- "name": "Albert Adler | @albertadler",
5
+ "name": "Albert Adler | @IAmAlbertAdler",
6
6
  "url": "https://albertadler.com"
7
7
  },
8
8
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "grid-background",
24
24
  "dot-background"
25
25
  ],
26
- "version": "1.2.7",
26
+ "version": "1.2.13",
27
27
  "type": "module",
28
28
  "main": "./dist/tailwind-dot-grid-backgrounds.umd.cjs",
29
29
  "module": "./dist/tailwind-dot-grid-backgrounds.js",
@@ -51,29 +51,23 @@
51
51
  "test": "vitest",
52
52
  "test:run": "vitest run",
53
53
  "test:coverage": "vitest run --coverage",
54
- "lint": "eslint . --ext .ts --report-unused-disable-directives --max-warnings 0",
55
- "lint:fix": "eslint --fix . --ext .ts --report-unused-disable-directives --max-warnings 0",
54
+ "lint": "biome check",
55
+ "lint:fix": "biome check --write",
56
56
  "prepare": "husky"
57
57
  },
58
58
  "devDependencies": {
59
- "@commitlint/cli": "19.3.0",
60
- "@commitlint/config-conventional": "19.2.2",
61
- "@types/eslint": "8.56.10",
62
- "@types/node": "20.12.12",
63
- "@typescript-eslint/eslint-plugin": "7.9.0",
64
- "@typescript-eslint/parser": "7.9.0",
65
- "@vitest/coverage-v8": "1.6.0",
66
- "eslint": "8.57.0",
67
- "eslint-config-prettier": "9.1.0",
68
- "eslint-plugin-prettier": "5.1.3",
69
- "husky": "9.0.11",
70
- "prettier": "3.2.5",
71
- "tailwindcss": "3.4.3",
72
- "postcss": "8.4.38",
73
- "typescript": "5.4.5",
74
- "vite": "5.2.11",
75
- "vite-plugin-dts": "3.9.1",
76
- "vitest": "1.6.0"
59
+ "@biomejs/biome": "1.9.3",
60
+ "@commitlint/cli": "19.5.0",
61
+ "@commitlint/config-conventional": "19.5.0",
62
+ "@types/node": "22.7.4",
63
+ "@vitest/coverage-v8": "2.1.2",
64
+ "husky": "9.1.6",
65
+ "tailwindcss": "3.4.13",
66
+ "postcss": "8.4.47",
67
+ "typescript": "5.6.2",
68
+ "vite": "5.4.8",
69
+ "vite-plugin-dts": "4.2.3",
70
+ "vitest": "2.1.2"
77
71
  },
78
72
  "peerDependencies": {
79
73
  "tailwindcss": ">=3.4.0"