Skip to content

Commit 9c9af79

Browse files
authored
chore(dependencies): add daisyui (#34932)
This pull request updates the DotCMS VTL migration skill and guide to standardize and clarify the use of DaisyUI for styling migrated custom fields. The documentation now emphasizes replacing legacy Dijit/Dojo widgets and ad-hoc CSS with DaisyUI component classes and Tailwind utilities for semantic, theme-aware, and maintainable UI. The migration process, rules, examples, and checklists are revised to guide developers in applying DaisyUI throughout migrated templates. **Styling and UI migration enhancements:** * Updated migration rules and checklists to require DaisyUI component classes (e.g. `btn`, `input`, `select`, `modal`, `link`) and Tailwind utilities for layout, replacing Dijit classes, inline styles, and ad-hoc CSS. Custom CSS is preserved only when DaisyUI/Tailwind are insufficient. (.claude/skills/vtl-migration/SKILL.md, [[1]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L23-R26) [[2]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L35-R38) [[3]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L80-R84) [[4]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2R151-R157); .claude/skills/vtl-migration/references/migration-guide.md, [[5]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L141-R144) [[6]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L152-L225) [[7]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L305-R367) [[8]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699R467) [[9]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L458-R513) * Added a new "Styling with DaisyUI" section to the migration guide, including component class quick reference, examples, and guidance on replacing inline styles and widgets with DaisyUI equivalents. (.claude/skills/vtl-migration/references/migration-guide.md, [[1]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L6-R11) [[2]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L305-R367) * Revised migration examples (dialogs, event handlers, text counters, title fields) to demonstrate DaisyUI usage for semantic styling, replacing legacy patterns and inline styles with DaisyUI and Tailwind classes. (.claude/skills/vtl-migration/SKILL.md, [[1]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L116-R136); .claude/skills/vtl-migration/references/migration-guide.md, [[2]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L152-L225) [[3]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L236-R216) [[4]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L633-R688) [[5]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L670-R698) [[6]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L734-R762) * Improved migration checklists and process steps to enforce DaisyUI/Tailwind styling, and clarified preservation of VTL variables and business logic. (.claude/skills/vtl-migration/SKILL.md, [[1]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L35-R38) [[2]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2R151-R157); .claude/skills/vtl-migration/references/migration-guide.md, [[3]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L458-R513) **Documentation and process clarity:** * Updated references throughout the skill and guide to point to the new DaisyUI styling section and examples, ensuring developers know where to find styling guidance. (.claude/skills/vtl-migration/SKILL.md, [[1]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L9-R11) [[2]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L23-R26) [[3]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L35-R38) [[4]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2R151-R157); .claude/skills/vtl-migration/references/migration-guide.md, [[5]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L6-R11) * Clarified that business logic and VTL variables remain unchanged, and that custom CSS is preserved only when DaisyUI/Tailwind cannot provide the needed styling. (.claude/skills/vtl-migration/SKILL.md, [[1]](diffhunk://#diff-c2b9ed9bda14805f7fda51366e12e2df2a16d5e5a76a2d1695705042e57f3da2L80-R84); .claude/skills/vtl-migration/references/migration-guide.md, [[2]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L411-L412) [[3]](diffhunk://#diff-c8a865197226c1c0647627d1d0ffcf5334beb5c3c24940c5c4bd44e7b63cb699L458-R513) These changes ensure that all migrated custom fields are styled consistently and semantically, leveraging DaisyUI and Tailwind for maintainability and theme compatibility. #33779
1 parent 1b886b5 commit 9c9af79

15 files changed

Lines changed: 472 additions & 747 deletions

File tree

.claude/skills/vtl-migration/SKILL.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ description: >
66

77
# VTL Migration: Legacy API → DotCustomFieldApi
88

9-
You are migrating DotCMS VTL custom field templates from Dojo/Dijit-era APIs to the modern `DotCustomFieldApi`. The goal is **identical functionality with modern, clean code**.
9+
You are migrating DotCMS VTL custom field templates from Dojo/Dijit-era APIs to the modern `DotCustomFieldApi`. The goal is **identical functionality with modern, clean code** and **semantic styling with DaisyUI**.
1010

11-
For the full migration rules, all code examples, and the step-by-step checklist, read `references/migration-guide.md`.
11+
For the full migration rules, all code examples, the DaisyUI styling section, and the step-by-step checklist, read `references/migration-guide.md`.
1212

1313
## The Core API Swap (Quick Reference)
1414

@@ -20,9 +20,10 @@ For the full migration rules, all code examples, and the step-by-step checklist,
2020
| `dojo.ready(fn)` | `DotCustomFieldApi.ready(fn)` |
2121
| `dojo.byId('el')` | `document.getElementById('el')` |
2222
| `dijit.byId('id')` | `DotCustomFieldApi.getField('id')` |
23-
| `dijit.form.*` widgets | Native HTML elements |
24-
| `dojoType="..."` attribute | Remove; use semantic HTML |
25-
| `class="dijit*"` classes | Remove dijit classes entirely |
23+
| `dijit.form.*` widgets | Native HTML + **DaisyUI** classes (`input`, `btn`, `select`, etc.) |
24+
| `dojoType="..."` attribute | Remove; use semantic HTML + DaisyUI components |
25+
| `class="dijit*"` classes | Remove; use **DaisyUI** component classes instead |
26+
| Inline styles / ad-hoc CSS | **DaisyUI** component classes + Tailwind utilities (see guide) |
2627
| `onclick="fn()"` inline handlers | `addEventListener('click', fn)` |
2728

2829
## Process
@@ -32,8 +33,9 @@ For the full migration rules, all code examples, and the step-by-step checklist,
3233
3. **Wrap everything in `DotCustomFieldApi.ready()`** — all field access must live inside this callback.
3334
4. **Store field references once** — call `getField()` once per field at the top of `ready()`, then reuse the reference.
3435
5. **Migrate each pattern** — follow the migration rules in `references/migration-guide.md`.
35-
6. **Preserve VTL variables**`${fieldId}`, `$maxChar`, `$variableName` are server-side; never change them.
36-
7. **Output three files** — see the File Output Pattern below.
36+
6. **Apply DaisyUI for styling** — use DaisyUI component classes (`btn`, `input`, `select`, `modal`, `link`, etc.) and Tailwind utilities instead of inline styles or ad-hoc CSS; see “Styling with DaisyUI” in the guide.
37+
7. **Preserve VTL variables**`${fieldId}`, `$maxChar`, `$variableName` are server-side; never change them.
38+
8. **Output three files** — see the File Output Pattern below.
3739

3840
## File Output Pattern
3941

@@ -77,8 +79,9 @@ This pattern lets both legacy and new edit modes coexist safely — old editor u
7779
- All `getField()` calls must be inside `DotCustomFieldApi.ready()`
7880
- Never use `DotCustomFieldApi.get()` or `DotCustomFieldApi.set()` (the old short forms)
7981
- VTL variables stay exactly as-is
80-
- Business logic stays exactly as-is — only the API calls change
81-
- Dijit CSS classes (any `class="dijit*"`) must be removed; custom CSS classes must be kept
82+
- Business logic stays exactly as-is — only the API calls and styling approach change
83+
- Dijit CSS classes (any `class="dijit*"`) must be removed
84+
- **Styling:** Prefer DaisyUI component classes + Tailwind utilities; keep custom CSS only when the guide says so
8285
- Translate non-English comments to English
8386

8487
## Key Patterns to Know
@@ -113,18 +116,31 @@ titleField.onChange((value) => {
113116
});
114117
```
115118

116-
**Native dialog** (replaces `dojoType="dijit.Dialog"`):
119+
**Native dialog with DaisyUI modal** (replaces `dojoType="dijit.Dialog"`):
117120
```html
118-
<dialog id="myDialog">...</dialog>
121+
<button type="button" id="openModalButton" class="btn btn-primary">Open modal</button>
122+
<dialog id="myDialog" class="modal">
123+
<div class="modal-box">
124+
<h3 class="font-bold text-lg">Hello!</h3>
125+
<p class="py-4">Press ESC key or click the button below to close</p>
126+
<div class="modal-action">
127+
<form method="dialog">
128+
<button type="submit" class="btn">Close</button>
129+
</form>
130+
</div>
131+
</div>
132+
</dialog>
119133
<script>
120-
DotCustomFieldApi.ready(() => {
121-
document.getElementById('openBtn').addEventListener('click', () => {
122-
document.getElementById('myDialog').showModal();
123-
});
134+
const myDialog = document.getElementById('myDialog');
135+
const openModalButton = document.getElementById('openModalButton');
136+
openModalButton?.addEventListener('click', () => {
137+
myDialog?.showModal();
124138
});
125139
</script>
126140
```
127141
142+
**Styling (DaisyUI):** Buttons → `btn`, `btn-primary`, `btn-ghost`, `btn-sm`. Inputs → `input input-bordered`. Selects → `select select-bordered`. Links → `link link-primary`. Use Tailwind for layout (`flex`, `gap`, `w-full`). Full reference in `references/migration-guide.md` → “Styling with DaisyUI”.
143+
128144
## Before Outputting
129145
130146
Verify the migration passes this checklist (details in `references/migration-guide.md`):
@@ -139,9 +155,10 @@ Verify the migration passes this checklist (details in `references/migration-gui
139155
- [ ] No `dojo.*` or `dijit.*` references remaining
140156
- [ ] No `dojoType` attributes remaining
141157
- [ ] No `dijit*` CSS classes remaining
158+
- [ ] Styling uses DaisyUI components where applicable (buttons, inputs, selects, modals, links) and Tailwind for layout; no inline styles unless necessary
142159
- [ ] All field access inside `DotCustomFieldApi.ready()`
143160
- [ ] All `getField()` calls stored in variables and reused
144161
- [ ] VTL variables unchanged
145162
- [ ] Business logic unchanged
146163
147-
For complete rules, all migration examples (character counter, title field, slug generator, dialogs, file browser), and edge cases → read `references/migration-guide.md`.
164+
For complete rules, **DaisyUI styling section**, all migration examples (character counter, title field, slug generator, dialogs, file browser), and edge cases → read `references/migration-guide.md`.

0 commit comments

Comments
 (0)