Skip to content

Commit 3e50081

Browse files
committed
Please provide the changes or files you would like summarized so I can generate the commit message for you.
1 parent 3115005 commit 3e50081

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

AI_GENERATION_SPEC.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,13 @@ Instead of complex style calculations in both JS and PHP, use CSS Variables:
9696
- **PHP**: Inject variables into the style attribute of the wrapper via `AssetResolver::INSTANCE`.
9797
- **JS**: Pass variables into the `style` prop of `useBlockProps`.
9898
- **CSS**: The block-level `.scss` uses these variables for layout, ensuring both environments render exactly the same layout without duplicated logic.
99+
100+
## 10. Template Spacing & Margin Rules
101+
102+
To prevent unnecessary whitespaces (khoảng trắng không cần thiết) in the generated themes:
103+
104+
1. **Root Main Margins**: Always set `margin-top: 0` and `margin-bottom: 0` on the root `<main>` or container groups in page templates. Default WordPress margins often cause white gaps between the header/footer and the dark theme content.
105+
- Example: `<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0","bottom":"0"},"padding":{"top":"0","bottom":"0"}}}} -->`
106+
2. **Card Wrappers**: When using `jankx/dynamic-data-template`, DO NOT apply borders, backgrounds, or padding directly to the template block itself. Instead, wrap the inner content (like images and text) in a `wp:group` and apply the styles there. This prevents the layout system from misapplying styles to the entire grid container.
107+
3. **Contrast & Link Colors**: Default `wp:post-title` and `wp:post-terms` generate blue links. Always use CSS overrides or proper wrapper classes (e.g., `.has-link-color`) to ensure text contrast remains readable on dark backgrounds.
108+
4. **Grid Layout Fix**: When forcing `.post-type-layout-grid` to `display: grid`, Jankx's built-in flex widths (e.g., `width: 33.3%`) will cause grid items to shrink drastically. Always pair it with `.post-type-layout-grid > * { width: 100% !important; max-width: 100% !important; flex: none !important; }`.

0 commit comments

Comments
 (0)