daisyui 4.3.0-alpha.10 → 4.3.0-alpha.2
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/full.css +1188 -0
- package/package.json +7 -7
- package/src/docs/src/lib/data/themes.js +34 -0
- package/src/experiments/playground/src/components/Demo.astro +160 -0
- package/src/experiments/playground/src/env.d.ts +1 -0
- package/src/experiments/playground/src/layouts/Main.astro +15 -0
- package/src/experiments/playground/src/pages/LTR.astro +8 -0
- package/src/experiments/playground/src/pages/RTL.astro +8 -0
- package/src/experiments/playground/src/pages/dark.astro +8 -0
- package/src/experiments/playground/src/pages/demo.astro +8 -0
- package/src/experiments/playground/src/pages/index.astro +32 -0
- package/src/experiments/playground/src/pages/light.astro +8 -0
- package/src/index.js +32 -34
- package/src/lib/addPrefix.js +6 -6
- package/src/lib/responsiveRegex.js +1 -1
- package/src/lib/utility-classes.js +1 -1
- package/src/theming/colorNames.js +1 -1
- package/src/theming/functions.js +185 -197
- package/src/theming/index.js +1 -1
- package/src/theming/themeDefaults.js +44 -46
- package/src/theming/themes.js +1 -1
- package/themes.js +2 -0
- /package/dist/{base.js → base.cjs} +0 -0
- /package/dist/{styled.js → styled.cjs} +0 -0
- /package/dist/{unstyled.js → unstyled.cjs} +0 -0
- /package/dist/{utilities-styled.js → utilities-styled.cjs} +0 -0
- /package/dist/{utilities-unstyled.js → utilities-unstyled.cjs} +0 -0
- /package/dist/{utilities.js → utilities.cjs} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daisyui",
|
|
3
|
-
"version": "4.3.0-alpha.
|
|
3
|
+
"version": "4.3.0-alpha.2",
|
|
4
4
|
"description": "daisyUI - Tailwind CSS Components",
|
|
5
5
|
"author": "Pouya Saadeghi",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/saadeghi/daisyui/issues"
|
|
18
18
|
},
|
|
19
|
+
"type": "module",
|
|
19
20
|
"keywords": [
|
|
20
21
|
"design-system",
|
|
21
22
|
"tailwindcss",
|
|
@@ -32,16 +33,16 @@
|
|
|
32
33
|
"ui"
|
|
33
34
|
],
|
|
34
35
|
"main": "src/index.js",
|
|
35
|
-
"
|
|
36
|
+
"module": "src/index.js",
|
|
36
37
|
"types": "src/index.d.ts",
|
|
37
38
|
"files": [
|
|
39
|
+
"themes.js",
|
|
38
40
|
"src/lib/**/*.js",
|
|
39
|
-
"dist/*.
|
|
41
|
+
"dist/*.cjs",
|
|
40
42
|
"dist/{themes,styled,unstyled,full}.css",
|
|
41
43
|
"src/index.js",
|
|
42
44
|
"src/theming/*.js",
|
|
43
|
-
"src
|
|
44
|
-
"src/index.d.ts"
|
|
45
|
+
"src/**/*.d.ts"
|
|
45
46
|
],
|
|
46
47
|
"engines": {
|
|
47
48
|
"node": ">=16.9.0"
|
|
@@ -63,8 +64,7 @@
|
|
|
63
64
|
"dev": "cd src/docs && npm run dev",
|
|
64
65
|
"playground": "cd src/experiments/playground && npm run dev",
|
|
65
66
|
"release": "node src/release",
|
|
66
|
-
"publish:alpha": "npm publish --tag=alpha"
|
|
67
|
-
"alpha": "npm run release -- --alpha && npm publish --tag=alpha"
|
|
67
|
+
"publish:alpha": "npm publish --tag=alpha"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"autoprefixer": "^10.4.16",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const themes = [
|
|
2
|
+
"light",
|
|
3
|
+
"dark",
|
|
4
|
+
"cupcake",
|
|
5
|
+
"bumblebee",
|
|
6
|
+
"emerald",
|
|
7
|
+
"corporate",
|
|
8
|
+
"synthwave",
|
|
9
|
+
"retro",
|
|
10
|
+
"cyberpunk",
|
|
11
|
+
"valentine",
|
|
12
|
+
"halloween",
|
|
13
|
+
"garden",
|
|
14
|
+
"forest",
|
|
15
|
+
"aqua",
|
|
16
|
+
"lofi",
|
|
17
|
+
"pastel",
|
|
18
|
+
"fantasy",
|
|
19
|
+
"wireframe",
|
|
20
|
+
"black",
|
|
21
|
+
"luxury",
|
|
22
|
+
"dracula",
|
|
23
|
+
"cmyk",
|
|
24
|
+
"autumn",
|
|
25
|
+
"business",
|
|
26
|
+
"acid",
|
|
27
|
+
"lemonade",
|
|
28
|
+
"night",
|
|
29
|
+
"coffee",
|
|
30
|
+
"winter",
|
|
31
|
+
"dim",
|
|
32
|
+
"nord",
|
|
33
|
+
"sunset",
|
|
34
|
+
]
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<div class="rounded-box bg-base-100 border-base-content/5 text-base-content not-prose grid gap-3 border p-6 max-w-2xl mx-auto my-6">
|
|
2
|
+
<div class="grid grid-cols-2 gap-2 md:grid-cols-4">
|
|
3
|
+
<button class="btn">Default</button>
|
|
4
|
+
<button class="btn btn-primary">Primary</button>
|
|
5
|
+
<button class="btn btn-secondary">Secondary</button>
|
|
6
|
+
<button class="btn btn-accent">Accent</button>
|
|
7
|
+
<button class="btn btn-info">Info</button>
|
|
8
|
+
<button class="btn btn-success">Success</button>
|
|
9
|
+
<button class="btn btn-warning">Warning</button>
|
|
10
|
+
<button class="btn btn-error">Error</button>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="grid grid-cols-2 place-items-center gap-2 md:grid-cols-4">
|
|
13
|
+
<span class="badge">Default</span>
|
|
14
|
+
<span class="badge badge-primary">Primary</span>
|
|
15
|
+
<span class="badge badge-secondary">Secondary</span>
|
|
16
|
+
<span class="badge badge-accent">Accent</span>
|
|
17
|
+
<span class="badge badge-info">Info</span>
|
|
18
|
+
<span class="badge badge-success">Success</span>
|
|
19
|
+
<span class="badge badge-warning">Warning</span>
|
|
20
|
+
<span class="badge badge-error">Error</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="flex flex-col gap-3">
|
|
23
|
+
<div class="flex flex-col gap-3 md:flex-row">
|
|
24
|
+
<div class="md:w-1/2">
|
|
25
|
+
<div class="tabs tabs-lifted">
|
|
26
|
+
<button class="tab ">Tab</button>
|
|
27
|
+
<button class="tab tab-active">Tab</button>
|
|
28
|
+
<button class="tab">Tab</button>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="flex flex-col">
|
|
31
|
+
<span class="link">I'm a simple link</span>
|
|
32
|
+
<span class="link link-primary">I'm a simple link</span>
|
|
33
|
+
<span class="link link-secondary">I'm a simple link</span>
|
|
34
|
+
<span class="link link-accent">I'm a simple link</span>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="flex flex-col gap-3 md:w-1/2">
|
|
38
|
+
<progress value="20" max="100" class="progress">Default</progress>
|
|
39
|
+
<progress value="25" max="100" class="progress progress-primary">Primary</progress>
|
|
40
|
+
<progress value="30" max="100" class="progress progress-secondary">Secondary</progress>
|
|
41
|
+
<progress value="40" max="100" class="progress progress-accent">Accent</progress>
|
|
42
|
+
<progress value="45" max="100" class="progress progress-info">Info</progress>
|
|
43
|
+
<progress value="55" max="100" class="progress progress-success">Success</progress>
|
|
44
|
+
<progress value="70" max="100" class="progress progress-warning">Warning</progress>
|
|
45
|
+
<progress value="90" max="100" class="progress progress-error">Error</progress>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="flex flex-col gap-3 md:flex-row">
|
|
49
|
+
<div class="stats bg-base-300 border-base-300 border md:w-1/2">
|
|
50
|
+
<div class="stat">
|
|
51
|
+
<div class="stat-title">Total Page Views</div>
|
|
52
|
+
<div class="stat-value">89,400</div>
|
|
53
|
+
<div class="stat-desc">21% more than last month</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="flex flex-wrap items-center justify-center gap-3 md:w-1/2">
|
|
57
|
+
<div class="radial-progress" style="--value:60; --size:3.5rem;">60%</div>
|
|
58
|
+
<div class="radial-progress" style="--value:75; --size:3.5rem;">75%</div>
|
|
59
|
+
<div class="radial-progress" style="--value:90; --size:3.5rem;">90%</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="flex flex-col gap-3">
|
|
64
|
+
<div class="flex flex-col gap-3 md:flex-row">
|
|
65
|
+
<div class="md:w-1/2">
|
|
66
|
+
<div>
|
|
67
|
+
<input type="checkbox" class="toggle" />
|
|
68
|
+
<input type="checkbox" class="toggle toggle-primary" />
|
|
69
|
+
<input type="checkbox" class="toggle toggle-secondary" />
|
|
70
|
+
<input type="checkbox" class="toggle toggle-accent" />
|
|
71
|
+
</div>
|
|
72
|
+
<div>
|
|
73
|
+
<input type="checkbox" class="checkbox" />
|
|
74
|
+
<input type="checkbox" class="checkbox checkbox-primary" />
|
|
75
|
+
<input type="checkbox" class="checkbox checkbox-secondary" />
|
|
76
|
+
<input type="checkbox" class="checkbox checkbox-accent" />
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<input type="radio" name="radio-1" class="radio" />
|
|
80
|
+
<input type="radio" name="radio-1" class="radio radio-primary" />
|
|
81
|
+
<input type="radio" name="radio-1" class="radio radio-secondary" />
|
|
82
|
+
<input type="radio" name="radio-1" class="radio radio-accent" />
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="md:w-1/2">
|
|
86
|
+
<input type="range" min="0" max="100" class="range range-xs" />
|
|
87
|
+
<input type="range" min="0" max="100" class="range range-xs range-primary" />
|
|
88
|
+
<input type="range" min="0" max="100" class="range range-xs range-secondary" />
|
|
89
|
+
<input type="range" min="0" max="100" class="range range-xs range-accent" />
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="flex flex-col gap-3 md:flex-row">
|
|
93
|
+
<div class="flex flex-col gap-3 md:w-1/2">
|
|
94
|
+
<input type="text" placeholder="Default" class="input input-bordered w-full" />
|
|
95
|
+
<input type="text" placeholder="Primary" class="input input-primary input-bordered w-full" />
|
|
96
|
+
<input type="text" placeholder="Secondary" class="input input-secondary input-bordered w-full" />
|
|
97
|
+
<input type="text" placeholder="Accent" class="input input-accent input-bordered w-full" />
|
|
98
|
+
</div>
|
|
99
|
+
<div class="flex flex-col gap-3 md:w-1/2">
|
|
100
|
+
<input type="text" placeholder="Info" class="input input-info input-bordered w-full" />
|
|
101
|
+
<input type="text" placeholder="Success" class="input input-success input-bordered w-full" />
|
|
102
|
+
<input type="text" placeholder="Warning" class="input input-warning input-bordered w-full" />
|
|
103
|
+
<input type="text" placeholder="Error" class="input input-error input-bordered w-full" />
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="navbar bg-neutral text-neutral-content rounded-box">
|
|
107
|
+
<div class="flex-none"><button class="btn btn-square btn-ghost"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block h-5 w-5 stroke-current"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg></button></div>
|
|
108
|
+
<div class="flex-1"><button class="btn btn-ghost text-xl normal-case">daisyUI</button></div>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="flex gap-3">
|
|
111
|
+
<div class="flex flex-grow flex-col gap-3">
|
|
112
|
+
<div class="text-4xl font-bold">Text Size 1</div>
|
|
113
|
+
<div class="text-3xl font-bold">Text Size 2</div>
|
|
114
|
+
<div class="text-2xl font-bold">Text Size 3</div>
|
|
115
|
+
<div class="text-xl font-bold">Text Size 4</div>
|
|
116
|
+
<div class="text-lg font-bold">Text Size 5</div>
|
|
117
|
+
<div class="text-sm font-bold">Text Size 6</div>
|
|
118
|
+
<div class="text-xs font-bold">Text Size 7</div>
|
|
119
|
+
</div>
|
|
120
|
+
<ul class="steps steps-vertical">
|
|
121
|
+
<li class="step step-primary">Step 1</li>
|
|
122
|
+
<li class="step step-primary">Step 2</li>
|
|
123
|
+
<li class="step">Step 3</li>
|
|
124
|
+
<li class="step">Step 4</li>
|
|
125
|
+
</ul>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="flex flex-col gap-3">
|
|
129
|
+
<div class="alert">
|
|
130
|
+
<div>
|
|
131
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 flex-shrink-0"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
|
132
|
+
<span>12 unread messages. Tap to see.</span>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="alert alert-info">
|
|
136
|
+
<div>
|
|
137
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="h-6 w-6 flex-shrink-0 stroke-current"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
|
138
|
+
<span>New software update available.</span>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="alert alert-success">
|
|
142
|
+
<div>
|
|
143
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 flex-shrink-0 stroke-current" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
|
144
|
+
<span>Your purchase has been confirmed!</span>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="alert alert-warning">
|
|
148
|
+
<div>
|
|
149
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 flex-shrink-0 stroke-current" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg>
|
|
150
|
+
<span>Warning: Invalid email address!</span>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="alert alert-error">
|
|
154
|
+
<div>
|
|
155
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 flex-shrink-0 stroke-current" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
|
156
|
+
<span>Error! Task failed successfully.</span>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="astro/client" />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import 'tailwindcss/tailwind.css'
|
|
3
|
+
const { dir } = Astro.props
|
|
4
|
+
const { theme } = Astro.props
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
<html lang="en" dir={dir} data-theme={theme}>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="utf-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width" />
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<slot />
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Main from "../layouts/Main.astro"
|
|
3
|
+
const pages = await Astro.glob("./*.astro")
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Main>
|
|
7
|
+
<div class="flex flex-col gap-10 min-h-screen justify-center items-center p-4">
|
|
8
|
+
<div class="w-full max-w-lg flex flex-col gap-4">
|
|
9
|
+
<h1 class="font-bold text-lg">Welcome to daisyUI playground</h1>
|
|
10
|
+
<div class="text-base-content/50 flex flex-col gap-4">
|
|
11
|
+
<p>This is a Astro project where you can test daisyUI components from the source style (not the NPM package)</p>
|
|
12
|
+
<p>
|
|
13
|
+
Start by editing this file:
|
|
14
|
+
<pre class="font-mono text-sm bg-base-200 px-1 rounded break-all whitespace-pre-wrap">/src/experiments/playground/src/components/Component.astro</pre>
|
|
15
|
+
</p>
|
|
16
|
+
<p>You can see the result and test the components in the following pages:</p>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<ul class="menu w-full max-w-lg border border-base-content/10 rounded-box">
|
|
20
|
+
<li class="menu-title">Pages</li>
|
|
21
|
+
{
|
|
22
|
+
pages.map((page) => (
|
|
23
|
+
<li>
|
|
24
|
+
<a class="font-mono" href={page.url}>
|
|
25
|
+
{page.url}
|
|
26
|
+
</a>
|
|
27
|
+
</li>
|
|
28
|
+
))
|
|
29
|
+
}
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
</Main>
|
package/src/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// const tailwindColors = require("tailwindcss/colors")
|
|
2
2
|
// const tailwindPlugin = require("tailwindcss/plugin")
|
|
3
|
-
|
|
3
|
+
import tailwindPlugin from "./lib/createPlugin"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { sync } from "postcss-js"
|
|
6
|
+
import { magenta, dim, yellow, blue, reset, green } from "picocolors"
|
|
7
|
+
import postcssPrefix from "./lib/addPrefix"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { version, funding } from "../package.json"
|
|
10
|
+
import utilities from "../dist/utilities.cjs"
|
|
11
|
+
import base from "../dist/base.cjs"
|
|
12
|
+
import unstyled from "../dist/unstyled.cjs"
|
|
13
|
+
import styled from "../dist/styled.cjs"
|
|
14
|
+
import utilitiesUnstyled from "../dist/utilities-unstyled.cjs"
|
|
15
|
+
import utilitiesStyled from "../dist/utilities-styled.cjs"
|
|
16
|
+
import { themes } from "./theming/themes"
|
|
17
|
+
import { injectThemes } from "./theming/functions"
|
|
18
|
+
import { utilityClasses } from "./lib/utility-classes"
|
|
19
|
+
import colorObject from "./theming/index"
|
|
20
20
|
|
|
21
21
|
const mainFunction = ({ addBase, addComponents, config }) => {
|
|
22
22
|
let logs = false
|
|
@@ -25,7 +25,7 @@ const mainFunction = ({ addBase, addComponents, config }) => {
|
|
|
25
25
|
}
|
|
26
26
|
if (logs) {
|
|
27
27
|
console.log()
|
|
28
|
-
console.log(`🌼 ${
|
|
28
|
+
console.log(`🌼 ${magenta("daisyUI")} ${dim(version)}`)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// inject @base style
|
|
@@ -44,7 +44,7 @@ const mainFunction = ({ addBase, addComponents, config }) => {
|
|
|
44
44
|
let postcssJsProcess
|
|
45
45
|
if (prefix) {
|
|
46
46
|
try {
|
|
47
|
-
postcssJsProcess =
|
|
47
|
+
postcssJsProcess = sync(postcssPrefix({ prefix, ignore: [] }))
|
|
48
48
|
} catch (error) {
|
|
49
49
|
logs && console.error(`Error occurred and prevent applying the "prefix" option:`, error)
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ const mainFunction = ({ addBase, addComponents, config }) => {
|
|
|
56
56
|
|
|
57
57
|
addComponents(file)
|
|
58
58
|
|
|
59
|
-
const themeInjector =
|
|
59
|
+
const themeInjector = injectThemes(addBase, config, themes)
|
|
60
60
|
themeInjector
|
|
61
61
|
|
|
62
62
|
// inject @utilities style needed by components
|
|
@@ -79,44 +79,42 @@ const mainFunction = ({ addBase, addComponents, config }) => {
|
|
|
79
79
|
if (logs) {
|
|
80
80
|
if (config("daisyui.styled") == false) {
|
|
81
81
|
console.log(
|
|
82
|
-
`├─ ${
|
|
83
|
-
"
|
|
84
|
-
)}
|
|
82
|
+
`├─ ${yellow("ℹ︎")} ${blue("styled")} ${reset("config is")} ${blue("false")} ${dim(
|
|
83
|
+
"\tcomponents won't have design decisions"
|
|
84
|
+
)}`
|
|
85
85
|
)
|
|
86
86
|
}
|
|
87
87
|
if (config("daisyui.utils") == false) {
|
|
88
88
|
console.log(
|
|
89
|
-
`├─ ${
|
|
90
|
-
"
|
|
91
|
-
)}
|
|
89
|
+
`├─ ${yellow("ℹ︎")} ${blue("utils")} ${reset("config is")} ${blue("false")} ${dim(
|
|
90
|
+
"\tdaisyUI utility classes are disabled"
|
|
91
|
+
)}`
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
if (config("daisyui.prefix") && config("daisyui.prefix") !== "") {
|
|
95
95
|
console.log(
|
|
96
|
-
`├─ ${
|
|
96
|
+
`├─ ${green("✔︎")} ${blue("prefix")} is enabled${dim(
|
|
97
97
|
"\t\tdaisyUI classnames must use"
|
|
98
|
-
)} ${
|
|
98
|
+
)} ${blue(config("daisyui.prefix"))} ${dim("prefix")}`
|
|
99
99
|
)
|
|
100
100
|
}
|
|
101
101
|
if (themeInjector.themeOrder.length > 0) {
|
|
102
102
|
console.log(
|
|
103
|
-
`├─ ${
|
|
103
|
+
`├─ ${green("✔︎")} ${themeInjector.themeOrder.length} ${
|
|
104
104
|
themeInjector.themeOrder.length > 1 ? "themes" : "theme"
|
|
105
|
-
} added${
|
|
105
|
+
} added${dim("\t\thttps://daisyui.com/docs/themes")}`
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
if (themeInjector.themeOrder.length === 0) {
|
|
109
109
|
console.log(
|
|
110
|
-
`├─ ${
|
|
110
|
+
`├─ ${yellow("ℹ︎")} All themes are disabled in config${dim(
|
|
111
111
|
"\t\thttps://daisyui.com/docs/themes"
|
|
112
112
|
)}`
|
|
113
113
|
)
|
|
114
114
|
}
|
|
115
115
|
let messages = [
|
|
116
|
-
`${
|
|
117
|
-
|
|
118
|
-
)}`,
|
|
119
|
-
`${pc.green("★")} ${pc.reset("Star daisyUI on GitHub")}\t${pc.dim(
|
|
116
|
+
`${green("❤︎")} ${reset("Support daisyUI project:")}\t${dim(funding.url)}`,
|
|
117
|
+
`${green("★")} ${reset("Star daisyUI on GitHub")}\t${dim(
|
|
120
118
|
"https://github.com/saadeghi/daisyui"
|
|
121
119
|
)}`,
|
|
122
120
|
]
|
|
@@ -125,7 +123,7 @@ const mainFunction = ({ addBase, addComponents, config }) => {
|
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
export default tailwindPlugin(mainFunction, {
|
|
129
127
|
theme: {
|
|
130
128
|
extend: {
|
|
131
129
|
colors: {
|
package/src/lib/addPrefix.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringify, parse } from "css-selector-tokenizer"
|
|
2
2
|
|
|
3
3
|
function itMatchesOne(arr, term) {
|
|
4
4
|
return arr.some((i) => term.search(i) >= 0)
|
|
@@ -61,7 +61,7 @@ function iterateSelectorNodes(selector, options) {
|
|
|
61
61
|
return iterateSelectorNodes(node, options)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
if (itMatchesOne(ignore,
|
|
64
|
+
if (itMatchesOne(ignore, stringify(node))) return node
|
|
65
65
|
|
|
66
66
|
return prefixNode(node, prefix)
|
|
67
67
|
}),
|
|
@@ -71,7 +71,7 @@ function iterateSelectorNodes(selector, options) {
|
|
|
71
71
|
/**
|
|
72
72
|
* @type {import('postcss').PluginCreator}
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
export default (opts = {}) => {
|
|
75
75
|
const { prefix, ignore } = {
|
|
76
76
|
prefix: "",
|
|
77
77
|
ignore: [],
|
|
@@ -92,13 +92,13 @@ module.exports = (opts = {}) => {
|
|
|
92
92
|
postcssPlugin: "addprefix",
|
|
93
93
|
Root(root, postcss) {
|
|
94
94
|
root.walkRules((rule) => {
|
|
95
|
-
const parsed =
|
|
95
|
+
const parsed = parse(rule.selector)
|
|
96
96
|
const selector = iterateSelectorNodes(parsed, { prefix, ignore })
|
|
97
97
|
|
|
98
|
-
rule.selector =
|
|
98
|
+
rule.selector = stringify(selector)
|
|
99
99
|
})
|
|
100
100
|
},
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
export const postcss = true
|