@blockbite/tailwind 3.4.13 → 3.4.14

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.
Files changed (75) hide show
  1. package/dist/___index copy.d.ts +7 -0
  2. package/dist/___index copy.js +9 -0
  3. package/dist/aspect-ratio.d.ts +1 -0
  4. package/dist/aspect-ratio.js +6 -0
  5. package/dist/colors.d.ts +8 -0
  6. package/dist/colors.js +65 -0
  7. package/dist/components/anchor-position.d.ts +3 -0
  8. package/dist/components/anchor-position.js +99 -0
  9. package/dist/components/fluid-container.d.ts +4 -0
  10. package/dist/components/fluid-container.js +29 -0
  11. package/dist/components/grid-container.d.ts +5 -0
  12. package/dist/components/grid-container.js +34 -0
  13. package/dist/components/interaction.d.ts +3 -0
  14. package/dist/components/interaction.js +35 -0
  15. package/dist/components/swiper.d.ts +3 -0
  16. package/dist/components/swiper.js +13 -0
  17. package/dist/container.d.ts +8 -0
  18. package/dist/container.js +10 -0
  19. package/dist/gridarea/index.d.ts +2 -0
  20. package/dist/gridarea/index.js +7 -0
  21. package/dist/gridarea/utilities/area-dimensions.d.ts +3 -0
  22. package/dist/gridarea/utilities/area-dimensions.js +22 -0
  23. package/dist/gridarea/utilities/grid-area.d.ts +5 -0
  24. package/dist/gridarea/utilities/grid-area.js +46 -0
  25. package/dist/index.d.ts +9 -0
  26. package/dist/index.js +32 -0
  27. package/dist/plugins/viewport-dimensions.d.ts +2 -0
  28. package/dist/plugins/viewport-dimensions.js +25 -0
  29. package/dist/screens.d.ts +5 -0
  30. package/dist/screens.js +10 -0
  31. package/dist/spacing.d.ts +6 -0
  32. package/dist/spacing.js +201 -0
  33. package/dist/theme-parser.d.ts +21 -0
  34. package/dist/theme-parser.js +68 -0
  35. package/package.json +26 -4
  36. package/CHANGELOG.md +0 -55
  37. package/components/anchor-position.js +0 -110
  38. package/components/fluid-container.js +0 -34
  39. package/components/grid-container.js +0 -37
  40. package/components/interaction.js +0 -37
  41. package/components/swiper.js +0 -13
  42. package/deprecated/fluid-container-aside.js +0 -48
  43. package/deprecated/fluid-container-half.js +0 -48
  44. package/dist/assets/index-BeSH1wKF.js +0 -74
  45. package/dist/assets/index-CFh4XZ-f.css +0 -1
  46. package/dist/index.html +0 -23
  47. package/gridarea/index.js +0 -6
  48. package/gridarea/utilities/area-dimensions.js +0 -13
  49. package/gridarea/utilities/grid-area.js +0 -49
  50. package/index.d.ts +0 -17
  51. package/index.html +0 -46
  52. package/index.js +0 -30
  53. package/lib/aspect-ratio.js +0 -6
  54. package/lib/colors.js +0 -58
  55. package/lib/container.js +0 -10
  56. package/lib/screens.js +0 -13
  57. package/lib/spacing.js +0 -215
  58. package/lib/theme-parser.js +0 -83
  59. package/motion/index.js +0 -17
  60. package/motion/theme.js +0 -174
  61. package/motion/utilities/delay.js +0 -11
  62. package/motion/utilities/direction.js +0 -15
  63. package/motion/utilities/duration.js +0 -11
  64. package/motion/utilities/fillMode.js +0 -15
  65. package/motion/utilities/iterationCount.js +0 -15
  66. package/motion/utilities/offset.js +0 -11
  67. package/motion/utilities/playState.js +0 -15
  68. package/motion/utilities/timingFunction.js +0 -15
  69. package/plugins/viewport-dimensions.js +0 -33
  70. package/postcss.config.js +0 -6
  71. package/tailwind.config.js +0 -18
  72. package/theme-example.json +0 -329
  73. package/themecolors/index.js +0 -65
  74. package/vite.css +0 -8
  75. package/vite.js +0 -64
@@ -1,48 +0,0 @@
1
- module.exports = function ({ addComponents, theme }) {
2
- const container = {
3
- ".b_container-fluid-half-r": {
4
- width: "var(--container-fluid-xs)",
5
- marginLeft: "auto",
6
- marginRight: "auto",
7
- paddingLeft: "1rem",
8
- paddingRight: "1rem",
9
- },
10
- ".b_container-fluid-half-l": {
11
- width: "var(--container-fluid-xs)",
12
- marginLeft: "auto",
13
- marginRight: "auto",
14
- paddingLeft: "1rem",
15
- paddingRight: "1rem",
16
- },
17
- };
18
-
19
- const maxWidth2xl = theme("screens.2xl");
20
- const minWidthLg = theme("screens.lg");
21
-
22
- if (minWidthLg) {
23
- container[`@media (min-width: ${minWidthLg})`] = {
24
- ".b_container-fluid-half-l": {
25
- width: "50%",
26
- marginLeft: `calc((100% - var(--container-fluid-xl)) / 2)`,
27
- },
28
- ".b_container-fluid-half-r": {
29
- width: "50%",
30
- marginRight: `calc((100% - var(--container-fluid-xl)) / 2 )`,
31
- },
32
- };
33
- }
34
- if (maxWidth2xl) {
35
- container[`@media (min-width: ${maxWidth2xl})`] = {
36
- ".b_container-fluid-half-l": {
37
- width: `calc(${maxWidth2xl} / 2)`,
38
- marginLeft: `calc((100% - ${maxWidth2xl}) / 2)`,
39
- },
40
- ".b_container-fluid-half-r": {
41
- width: `calc(${maxWidth2xl} / 2)`,
42
- marginRight: `calc((100% - ${maxWidth2xl}) / 2)`,
43
- },
44
- };
45
- }
46
-
47
- addComponents(container);
48
- };
@@ -1,74 +0,0 @@
1
- import a from"https://esm.sh/tailwindcss-in-browser@0.1.3";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))s(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function d(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(e){if(e.ep)return;e.ep=!0;const r=d(e);fetch(e.href,r)}})();const i=`
2
- <div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md space-y-4">
3
- <h1 class="text-2xl font-bold">Hello, Tailwind CSS v4!</h1>
4
- <p class="text-gray-500">This is a sample component styled with Tailwind CSS v4 in the browser.</p>
5
- </div>
6
- `,c=`
7
- @theme {
8
- --color-primary: #3b82f6;
9
- --color-secondary: #64748b;
10
- --font-sans: 'Inter', sans-serif;
11
- }
12
- `;a(i,c).then(o=>{const t=document.createElement("style");t.textContent=o,document.head.appendChild(t)});document.querySelector("#app").innerHTML=`
13
- <div style="--b_full:100%;">
14
- <div class="w-full h-[500px] grid b_grid-area-64 bg-red-200">
15
- <h1 class="bg-yellow-200 b_area md:b_area-x-6 md:b_area-y-4 md:b_area-w-14 md:b_area-h-14">Grid area </h1>
16
- </div>
17
-
18
-
19
- <div class="w-full h-[500px] grid b_grid-area-64 bg-red-200">
20
- <h1 class="bg-yellow-200 b_area-[1-1-20-40]">Grid area !</h1>
21
- </div>
22
-
23
- <div class="container bg-red-yellow-200 my-4 mx-auto">
24
- <h4 class="border-red-200 text-4xl border border-red-200 h-[300px]">container tailwind</h4>
25
- </div>
26
-
27
-
28
- <div class="b_container-fluid bg-red-yellow-200 my-4">
29
- <h4 class="border-red-200 text-4xl border border-red-200 h-[300px]">container fluid</h4>
30
- </div>
31
-
32
- <div class="b_grid-container bg-red-yellow-200 my-4 h-[300px]">
33
- <h4 class="border border-red-200 text-4xl col-span-12 col-start-2">container grid</h4>
34
- </div>
35
-
36
- <div class="b_grid-container bg-red-yellow-200 my-4 h-[300px]">
37
- <h4 class="border border-red-200 text-4xl col-span-7 col-start-1">left</h4>
38
- <p class="border border-red-200 text-4xl col-span-6">right</p>
39
- </div>
40
-
41
- <div class="b_grid-container bg-red-yellow-200 my-4 h-[300px]">
42
- <h4 class="border border-red-200 text-4xl col-span-6 col-start-2">left</h4>
43
- <p class="border border-red-200 text-4xl col-span-7 col-start-8">right</p>
44
- </div>
45
-
46
- <div class="b_grid-container bg-yellow-200 my-4 h-[300px]">
47
- <h4 class="border bg-red-200 text-4xl col-span-7 col-start-1 row-start-1">left image</h4>
48
- <h4 class="border border-blue-200 bg-blue-200 bg-opacity-40 text-4xl col-span-6 col-start-2 row-start-1">left text with extra layer</h4>
49
- <p class="border border-red-200 text-4xl col-span-6">right</p>
50
- </div>
51
-
52
-
53
- <div class="b_grid-container bg-yellow-200 my-4 h-[300px]">
54
- <h4 class="border bg-red-200 text-4xl col-span-7 col-start-8 row-start-1 text-right">right image</h4>
55
- <h4 class="border border-blue-200 bg-blue-200 bg-opacity-40 text-4xl col-span-6 col-start-8 row-start-1">left text</h4>
56
- <p class="border border-red-200 text-4xl col-span-6">left</p>
57
- </div>
58
-
59
-
60
- <div class="b_grid-container bg-yellow-200 my-4 h-[300px] w-full">
61
- <div class="border bg-red-200 text-4xl col-span-7 col-start-1 row-start-1">
62
- <h4 class="border border-blue-200 bg-blue-200 bg-opacity-40 text-4xl" style="padding-left:var(--b_fr-size);">left text with --b_fr-size</h4>
63
- </div>
64
-
65
- <p class="border border-red-200 text-4xl col-span-6">right</p>
66
- </div>
67
-
68
- <div class="b_theme-bg-red-500 bg-yellow-300 text-white p-40 text-3xl">
69
- Works beautifully 🎨
70
- <div class="bg-b_theme">This should be red from the parent</div>
71
- </div>
72
-
73
- </div>
74
- `;
@@ -1 +0,0 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--b_padding, 1rem);padding-left:var(--b_padding, 1rem)}@media (min-width: 640px){.container{max-width:640px;padding-right:var(--b_padding, 1rem);padding-left:var(--b_padding, 1rem)}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px;padding-right:var(--b_padding, 1rem);padding-left:var(--b_padding, 1rem)}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.area{grid-area:var(--b_area-y) / var(--b_area-x) / calc(var(--b_area-y) + var(--b_area-h)) / calc(var(--b_area-x) + var(--b_area-w))}.b_grid-area-64{display:grid;grid-template-columns:repeat(64,1fr);grid-template-rows:repeat(64,1fr);--init-area: 1 / 1 / 16 / 16}.col-span-12{grid-column:span 12 / span 12}.col-span-6{grid-column:span 6 / span 6}.col-span-7{grid-column:span 7 / span 7}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-8{grid-column-start:8}.row-start-1{grid-row-start:1}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.grid{display:grid}.h-\[300px\]{height:300px}.h-\[500px\]{height:500px}.w-full{width:100%}.border{border-width:1px}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-300{--tw-bg-opacity: 1;background-color:rgb(253 224 71 / var(--tw-bg-opacity, 1))}.bg-opacity-40{--tw-bg-opacity: .4}.p-40{padding:10rem}.text-right{text-align:right}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.b_theme-bg-red-500{--theme-bg: #ef4444}.bg-b_theme{background-color:var(--theme-bg)}h1{font-size:2.25rem;line-height:2.5rem}
package/dist/index.html DELETED
@@ -1,23 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite App</title>
8
-
9
-
10
- <script type="module" crossorigin src="/assets/index-BeSH1wKF.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-CFh4XZ-f.css">
12
- </head>
13
-
14
-
15
- <body>
16
- <div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md space-y-4">
17
- <h1 class="text-2xl font-bold">Hello, Tailwind CSS v4!</h1>
18
- <p class="text-gray-500">This is a sample component styled with Tailwind CSS v4 in the browser.</p>
19
- </div>
20
- <div id="app"></div>
21
- </body>
22
-
23
- </html>
package/gridarea/index.js DELETED
@@ -1,6 +0,0 @@
1
- const plugin = require('tailwindcss/plugin');
2
-
3
- module.exports = plugin((api) => {
4
- require('./utilities/area-dimensions')(api);
5
- require('./utilities/grid-area')(api);
6
- });
@@ -1,13 +0,0 @@
1
- module.exports = function ({ addUtilities, e }) {
2
- const newUtilities = {};
3
-
4
- // 96 is max resolution
5
- for (let i = 0; i <= 97; i++) {
6
- newUtilities[`.${e(`area-x-${i}`)}`] = { '--b_area-x': `${i}` };
7
- newUtilities[`.${e(`area-y-${i}`)}`] = { '--b_area-y': `${i}` };
8
- newUtilities[`.${e(`area-w-${i}`)}`] = { '--b_area-w': `${i}` };
9
- newUtilities[`.${e(`area-h-${i}`)}`] = { '--b_area-h': `${i}` };
10
- }
11
-
12
- addUtilities(newUtilities, ['responsive']);
13
- };
@@ -1,49 +0,0 @@
1
- module.exports = function ({ addComponents, matchUtilities, config }) {
2
- const important = config('important');
3
- const prefix = typeof important === 'string' ? important : '';
4
- // Predefined grid-area utilities
5
- addComponents({
6
- [`${prefix} .area`]: {
7
- gridArea:
8
- 'var(--b_area-y) / var(--b_area-x) / calc(var(--b_area-y) + var(--b_area-h)) / calc(var(--b_area-x) + var(--b_area-w))',
9
- },
10
- [`${prefix} .b_grid-area-16`]: {
11
- display: 'grid',
12
- gridTemplateColumns: 'repeat(16, 1fr)',
13
- gridTemplateRows: 'repeat(16, 1fr)',
14
- '--init-area': '1 / 1 / 4 / 4',
15
- },
16
- [`${prefix} .b_grid-area-32`]: {
17
- display: 'grid',
18
- gridTemplateColumns: 'repeat(32, 1fr)',
19
- gridTemplateRows: 'repeat(32, 1fr)',
20
- '--init-area': '1 / 1 / 8 / 8',
21
- },
22
- [`${prefix} .b_grid-area-64`]: {
23
- display: 'grid',
24
- gridTemplateColumns: 'repeat(64, 1fr)',
25
- gridTemplateRows: 'repeat(64, 1fr)',
26
- '--init-area': '1 / 1 / 16 / 16',
27
- },
28
- [`${prefix} .b_grid-area-96`]: {
29
- display: 'grid',
30
- gridTemplateColumns: 'repeat(96, 1fr)',
31
- gridTemplateRows: 'repeat(96, 1fr)',
32
- '--init-area': '1 / 1 / 24 / 24',
33
- },
34
- });
35
- matchUtilities(
36
- {
37
- area: (value) => {
38
- // Remove the square brackets and split the value by "/"
39
- const parts = value.split('-'); // slice to remove the square brackets
40
- if (parts.length === 4) {
41
- return {
42
- 'grid-area': `${parts[0]} / ${parts[1]} / ${parts[2]} / ${parts[3]}`,
43
- };
44
- }
45
- },
46
- },
47
- { values: {} } // Allow arbitrary values like b_area[1/4/4/3]
48
- );
49
- };
package/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- declare module "@blockbite/tailwind" {
2
- // Function declarations
3
- export function getAspectRatio(...args: any[]): any;
4
- export function getContainer(...args: any[]): any;
5
- export function getScreens(...args: any[]): any;
6
- export function getColors(...args: any[]): any;
7
- export function getColorObject(...args: any[]): any;
8
- export function themeParser(...args: any[]): any;
9
-
10
- // Constant declarations
11
- export const gridSpacing: any;
12
- export const fluidSpacing: any;
13
- export const screenSpacing: any;
14
- export const percentSpacing: any;
15
- export const nativeSpacing: any;
16
- export const spanSpacing: any;
17
- }
package/index.html DELETED
@@ -1,46 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite App</title>
8
-
9
-
10
- <script type="module">
11
- import buildCss from "https://esm.sh/tailwindcss-in-browser@0.1.3";
12
-
13
- const markup = `
14
- <div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md space-y-4">
15
- <h1 class="text-2xl font-bold">Hello, Tailwind CSS v4!</h1>
16
- <p class="text-gray-500">This is a sample component styled with Tailwind CSS v4 in the browser.</p>
17
- </div>
18
- `;
19
-
20
- const configurationCss = `
21
- @theme {
22
- --color-primary: #3b82f6;
23
- --color-secondary: #64748b;
24
- --font-sans: 'Inter', sans-serif;
25
- }
26
- `;
27
-
28
- buildCss(markup, configurationCss).then((css) => {
29
- const styleTag = document.createElement("style");
30
- styleTag.textContent = css;
31
- document.head.appendChild(styleTag);
32
- });
33
- </script>
34
- </head>
35
-
36
-
37
- <body>
38
- <div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md space-y-4">
39
- <h1 class="text-2xl font-bold">Hello, Tailwind CSS v4!</h1>
40
- <p class="text-gray-500">This is a sample component styled with Tailwind CSS v4 in the browser.</p>
41
- </div>
42
- <div id="app"></div>
43
- <script type="module" src="/vite.js"></script>
44
- </body>
45
-
46
- </html>
package/index.js DELETED
@@ -1,30 +0,0 @@
1
- // Import functions and constants
2
- import { getAspectRatio } from './lib/aspect-ratio';
3
- import { getColorObject, getColors } from './lib/colors';
4
- import { getContainer } from './lib/container';
5
- import { getScreens } from './lib/screens';
6
- import {
7
- fluidSpacing,
8
- gridSpacing,
9
- nativeSpacing,
10
- percentSpacing,
11
- screenSpacing,
12
- spanSpacing,
13
- } from './lib/spacing';
14
- import { themeParser } from './lib/theme-parser';
15
-
16
- // Export functions and constants
17
- export {
18
- fluidSpacing,
19
- getAspectRatio,
20
- getColorObject,
21
- getColors,
22
- getContainer,
23
- getScreens,
24
- gridSpacing,
25
- nativeSpacing,
26
- percentSpacing,
27
- screenSpacing,
28
- spanSpacing,
29
- themeParser,
30
- };
@@ -1,6 +0,0 @@
1
- export const getAspectRatio = (prefix = 'b_') => {
2
- const ratios = {};
3
- ratios[prefix + 'portrait'] = '3 / 4';
4
- ratios[prefix + 'landscape'] = '4 / 3';
5
- return ratios;
6
- };
package/lib/colors.js DELETED
@@ -1,58 +0,0 @@
1
- const colors = [
2
- 'b_theme',
3
- 'black',
4
- 'white',
5
- 'transparent',
6
- 'inherit',
7
- 'current',
8
- 'gray',
9
- 'red',
10
- 'yellow',
11
- 'green',
12
- 'blue',
13
- 'indigo',
14
- 'purple',
15
- 'pink',
16
- ];
17
-
18
- const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
19
-
20
- export const isSpecialColor = (color) =>
21
- ['black', 'white', 'transparent', 'inherit', 'current', 'b_theme'].includes(
22
- color
23
- );
24
-
25
- export const getColors = () => {
26
- const tailwindColors = {};
27
-
28
- colors.forEach((color) => {
29
- if (isSpecialColor(color)) {
30
- tailwindColors[color] = color;
31
- } else {
32
- shades.forEach((shade) => {
33
- tailwindColors[`${color}-${shade}`] = `${color}-${shade}`;
34
- });
35
- }
36
- });
37
-
38
- return tailwindColors;
39
- };
40
-
41
- export const getColorObject = () => {
42
- const colorObjects = colors.flatMap((color) => {
43
- if (isSpecialColor(color)) {
44
- return {
45
- label: `${color.charAt(0).toUpperCase() + color.slice(1)}`,
46
- id: color,
47
- };
48
- }
49
- return shades.map((shade) => ({
50
- label: `${color.charAt(0).toUpperCase() + color.slice(1)} ${shade}`,
51
- id: `${color}-${shade}`,
52
- }));
53
- });
54
-
55
- return colorObjects;
56
- };
57
-
58
- export default { getColors, getColorObject };
package/lib/container.js DELETED
@@ -1,10 +0,0 @@
1
- export const getContainer = () => {
2
- return {
3
- center: true,
4
- padding: {
5
- DEFAULT: 'var(--b_padding, 1rem)',
6
- sm: 'var(--b_padding, 1rem)',
7
- lg: 'var(--b_padding, 1rem)',
8
- },
9
- };
10
- };
package/lib/screens.js DELETED
@@ -1,13 +0,0 @@
1
- export const getScreens = (
2
- prefix = 'b_',
3
- minxmax = { min: '768px', max: '1100px', max2xl: '1440px' }
4
- ) => {
5
- // max 320px
6
- const screens = {};
7
- screens[prefix + 'xs'] = { max: minxmax.min };
8
- screens[prefix + 'md'] = { min: minxmax.min, max: minxmax.max };
9
- screens[prefix + 'xl'] = { min: minxmax.max };
10
- screens[prefix + 'sm'] = { max: minxmax.max };
11
- screens[prefix + '2xl'] = { min: minxmax.max2xl };
12
- return screens;
13
- };
package/lib/spacing.js DELETED
@@ -1,215 +0,0 @@
1
- function createFluidSpacing(prefix) {
2
- const fluid = [
3
- {
4
- size: '0px',
5
- slug: '0',
6
- name: '0',
7
- },
8
- {
9
- size: 'clamp(16px, 1vw, 32px)',
10
- slug: '1',
11
- name: '1',
12
- },
13
- {
14
- size: 'clamp(32px, 1vw, 48px)',
15
- slug: '2',
16
- name: '2',
17
- },
18
- {
19
- size: 'clamp(40px, 1vw, 50px)',
20
- slug: '3',
21
- name: '3',
22
- },
23
- {
24
- size: 'clamp(64px, 1vw, 80px)',
25
- slug: '4',
26
- name: '4',
27
- },
28
- {
29
- size: 'clamp(128px, 1vw, 144px)',
30
- slug: '5',
31
- name: '5',
32
- },
33
- {
34
- size: 'clamp(144px, 1vw, 164px)',
35
- slug: '6',
36
- name: '6',
37
- },
38
- {
39
- slug: '8',
40
- size: 'clamp(16px, 1vw, 32px)',
41
- name: '8',
42
- },
43
- {
44
- slug: '9',
45
- size: 'clamp(16px, 1vw, 32px)',
46
- name: '9',
47
- },
48
- {
49
- slug: '10',
50
- size: 'clamp(16px, 1vw, 32px)',
51
- name: '10',
52
- },
53
- // can be used to push contain inside grid-container
54
- {
55
- slug: '1fr',
56
- size: 'var(--b_fr-size, 1rem)',
57
- name: '1FR',
58
- },
59
- ];
60
-
61
- const FluidSizes = {};
62
- // add clamp spacing for gaps
63
- fluid.forEach((size) => {
64
- // add to spacing
65
- FluidSizes[prefix + 'fluid-' + size.slug] = size.size;
66
- });
67
-
68
- return FluidSizes;
69
- }
70
-
71
- function createPercentSpacing() {
72
- const percentUnits = [
73
- '1/2',
74
- '1/3',
75
- '2/3',
76
- '1/4',
77
- '2/4',
78
- '3/4',
79
- '1/5',
80
- '2/5',
81
- '3/5',
82
- '4/5',
83
- '1/6',
84
- '2/6',
85
- '3/6',
86
- '4/6',
87
- '5/6',
88
- '1/12',
89
- '2/12',
90
- '3/12',
91
- '4/12',
92
- '5/12',
93
- '6/12',
94
- '7/12',
95
- '8/12',
96
- '9/12',
97
- '10/12',
98
- '11/12',
99
- 'full',
100
- ];
101
- return percentUnits;
102
- }
103
- function createScreenSpacing() {
104
- const screenSpacing = [
105
- 'b_screen-10',
106
- 'b_screen-20',
107
- 'b_screen-30',
108
- 'b_screen-40',
109
- 'b_screen-50',
110
- 'b_screen-60',
111
- 'b_screen-70',
112
- 'b_screen-80',
113
- 'b_screen-90',
114
- 'b_screen-100',
115
- ];
116
-
117
- const screenSpacingValues = {};
118
- screenSpacing.forEach((size) => {
119
- screenSpacingValues[size] = size;
120
- });
121
- return screenSpacingValues;
122
- }
123
-
124
- function createGridSpacing(prefix) {
125
- // create grid based on 16px
126
- const gridSpacing = {};
127
-
128
- const minimalValues = [0, 1, 2, 4, 6, 8, 10, 12, 14, 18, 20, 22, 24, 32];
129
- for (let i = 0; i < minimalValues.length; i++) {
130
- const minimalValue = minimalValues[i];
131
- gridSpacing[`${prefix}${minimalValue}`] = minimalValue / 16 + 'rem';
132
- }
133
- for (let i = 1; i < 1280 / 16; i++) {
134
- const gridsize = i * 16;
135
- gridSpacing[`${prefix}${gridsize}`] = i + 'rem';
136
- }
137
- return gridSpacing;
138
- }
139
-
140
- function createNativeSpacing() {
141
- const nativeSpacing = [
142
- 0,
143
- 'px',
144
- 0.5,
145
- 1,
146
- 1.5,
147
- 2,
148
- 2.5,
149
- 3,
150
- 3.5,
151
- 4,
152
- 5,
153
- 6,
154
- 7,
155
- 8,
156
- 9,
157
- 10,
158
- 11,
159
- 12,
160
- 14,
161
- 16,
162
- 20,
163
- 24,
164
- 28,
165
- 32,
166
- 36,
167
- 40,
168
- 44,
169
- 48,
170
- 52,
171
- 56,
172
- 60,
173
- 64,
174
- 72,
175
- 80,
176
- 96,
177
- ];
178
- return nativeSpacing;
179
- }
180
-
181
- function createSpanSpacing() {
182
- const colSpanValues = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
183
- return colSpanValues;
184
- }
185
-
186
- export const gridSpacing = (prefix = '') => {
187
- // create grid based on 16px
188
- const spacingRem = createGridSpacing(prefix);
189
- return spacingRem;
190
- };
191
-
192
- export const fluidSpacing = (prefix = '') => {
193
- const spacingFluid = createFluidSpacing(prefix);
194
- return spacingFluid;
195
- };
196
-
197
- export const percentSpacing = () => {
198
- const spacingPercent = createPercentSpacing();
199
- return spacingPercent;
200
- };
201
-
202
- export const screenSpacing = () => {
203
- const spacingScreen = createScreenSpacing();
204
- return spacingScreen;
205
- };
206
-
207
- export const nativeSpacing = () => {
208
- const spacingNative = createNativeSpacing();
209
- return spacingNative;
210
- };
211
-
212
- export const spanSpacing = () => {
213
- const spacingSpan = createSpanSpacing();
214
- return spacingSpan;
215
- };