Skip to content

feat: Tailwind 4 integration lessons + brand/theme generation improvements#137

Merged
garrity-miepub merged 6 commits into
mainfrom
lessons/tailwind4-integration
Mar 14, 2026
Merged

feat: Tailwind 4 integration lessons + brand/theme generation improvements#137
garrity-miepub merged 6 commits into
mainfrom
lessons/tailwind4-integration

Conversation

@horner

@horner horner commented Mar 12, 2026

Copy link
Copy Markdown
Member

Summary

Adds a lessons/ folder documenting real-world integration pain points discovered during the timehuddle migration, plus concrete code changes to the brand theming system and CSS setup files.

Documentation

  • lessons/README.md — Index
  • lessons/tailwind4-integration.md — Tailwind 4 setup guide for any consumer
  • lessons/migration-meteor-blaze-to-react.md — Full migration playbook
  • lessons/recommended-changes.md — P0-P3 library improvement proposals

Code Changes

  • src/brands/types.ts: Extended generateTailwindTheme() to include optional color scales (secondary, neutral, destructive, success, warning, info) when present in BrandConfig — aligns Tailwind preset output with generateBrandCSS() behavior
  • src/styles/init.css: New quick-start CSS file with @theme block, dark mode variant, and brand tokens (exported as ./init.css)
  • src/styles/setup.css: Demoted to documentation-only reference snippet (not exported, not copied to dist)
  • package.json: Added ./init.css export; removed ./setup.css export; stopped copying setup.css to dist

Key Recommendations (from lessons/)

  • P0: Add CSS fallbacks to all var() in base.css @theme
  • P0: Extend generateBrandCSS() to emit all 7 color scales
  • P1: Ship init.css with @theme + @custom-variant directives
  • P1: Consolidate duplicate dark-mode CSS blocks
  • P2: Add optional full color scales to BrandConfig type
  • P2: Deprecate safelist for Tailwind 4 users

- tailwind4-integration.md: Setup guide for any Tailwind 4 consumer
  (@source, @custom-variant, CSS variable fallbacks, PostCSS config)
- migration-meteor-blaze-to-react.md: Full migration playbook from
  Meteor 2/Blaze to Meteor 3/React + @mieweb/ui
- recommended-changes.md: P0-P3 library improvement proposals
  (generateBrandCSS scales, dark mode consolidation, BrandConfig types)
- README.md: Index for the lessons folder

Extracted from real-world timehuddle migration pain points.
Copilot AI review requested due to automatic review settings March 12, 2026 21:27
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 12, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3458b72
Status: ✅  Deploy successful!
Preview URL: https://da26e295.ui-6d0.pages.dev
Branch Preview URL: https://lessons-tailwind4-integratio.ui-6d0.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new lessons/ documentation area capturing Tailwind CSS 4 + @mieweb/ui integration gotchas and a Meteor Blaze→React migration playbook, plus a maintainer-focused list of follow-up improvements for the library.

Changes:

  • Added a Tailwind 4 consumer integration guide covering @source, PostCSS setup, dark mode, and brand switching.
  • Added a Meteor 2 (Blaze) → Meteor 3 (React) migration playbook with suggested project structure and hooks.
  • Added a maintainer-oriented “recommended changes” doc to eliminate common consumer workarounds.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
lessons/README.md Index page linking the new lessons documents.
lessons/tailwind4-integration.md Tailwind 4 integration guide with setup snippets and troubleshooting checklist.
lessons/migration-meteor-blaze-to-react.md End-to-end migration playbook and operational checklist for Meteor/React/Tailwind 4.
lessons/recommended-changes.md Prioritized proposals (P0–P3) for improving @mieweb/ui consumer experience.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread lessons/tailwind4-integration.md Outdated
Comment thread lessons/tailwind4-integration.md Outdated
Comment thread lessons/tailwind4-integration.md Outdated
Comment thread lessons/recommended-changes.md
horner added 2 commits March 12, 2026 17:34
- P0: Add hex fallback values to all var() in @theme for non-primary scales
  (neutral, secondary, destructive, success, warning, info) so they resolve
  to Tailwind defaults when brand CSS doesn't define them
- P0: Update generateBrandCSS() to iterate over all color scales in brand
  config, not just primary — brands that define secondary/neutral/etc. now
  get those emitted automatically
- P2: Extend BrandColors interface with optional secondary, neutral,
  destructive, success, warning, and info ColorScale fields
- P1: Consolidate duplicate dark-mode blocks ([data-theme='dark'] and .dark)
  into a single combined selector
- P1: Created setup.css with @source + @custom-variant directives
- P2: Added @deprecated JSDoc to safelist for Tailwind 4 users
- P3: Created init.css single-import quick-start file
- Updated package.json exports and build scripts for new CSS files
Copilot AI review requested due to automatic review settings March 12, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/brands/types.ts
Comment thread lessons/tailwind4-integration.md
Comment thread lessons/recommended-changes.md
Comment thread package.json
Comment thread lessons/tailwind4-integration.md Outdated
Comment thread lessons/tailwind4-integration.md Outdated
Comment thread src/styles/setup.css Outdated
Comment thread src/styles/init.css Outdated
horner and others added 2 commits March 12, 2026 17:56
…ompt

- adopting-mieweb-ui.md: framework-agnostic 4-phase guide (audit, resolution, testing, verification)
- component-policy.md: 3-tier policy (use first → build locally → contribute upstream)
- compliance-prompt.md: reusable AI prompt for auditing any project
- README.md: reorganized index with Start Here and Reference sections
Code fixes:
- src/brands/types.ts: generateTailwindTheme() now includes all optional
  color scales (secondary, neutral, destructive, success, warning, info)
  when present in BrandConfig, matching generateBrandCSS() behavior.
- src/styles/init.css: removed @import 'tailwindcss' and @source directive
  that cannot resolve from inside node_modules. Header now instructs
  consumers to add those lines to their own CSS entry point.
- src/styles/setup.css: demoted to documentation-only reference. Active
  CSS directives moved into a comment block since @source cannot resolve
  when imported from node_modules.
- package.json: removed ./setup.css export (docs-only, not importable).
  Kept ./init.css which still provides real value (@theme + brand tokens).

Documentation fixes:
- lessons/tailwind4-integration.md: reworded content array claim (TW4
  still supports it, just not for node_modules scanning), clarified
  subpath brand imports, fixed secondary palette table and copy-paste
  snippet from gray to Indigo to match base.css, changed @theme inline
  to @theme, fixed darkMode config selector.
- lessons/recommended-changes.md: clarified transparent var scope (only
  when consuming brand CSS without library defaults), fixed secondary
  palette reference from gray to Indigo.
Copilot AI review requested due to automatic review settings March 13, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/init.css Outdated
Comment thread package.json
Comment thread lessons/recommended-changes.md Outdated
Comment thread package.json Outdated
Comment thread src/tailwind-preset.ts Outdated
Comment thread src/styles/setup.css
@garrity-miepub garrity-miepub changed the title docs: add lessons learned from Tailwind 4 + @mieweb/ui integration feat: Tailwind 4 integration lessons + brand/theme generation improvements Mar 13, 2026
- init.css: rewrite header to show the full 3-line consumer setup
  instead of claiming "a single import" (clarifies that @import
  'tailwindcss' and @source must live in the consumer's own CSS)
- package.json: stop copying setup.css to dist/ (it's docs-only,
  not an importable stylesheet, and has no package.json export)
- tailwind-preset.ts: remove stale reference to @mieweb/ui/setup.css
  in the safelist JSDoc comment
- recommended-changes.md: rewrite setup.css proposal to recommend
  copy-paste snippets instead of an importable file (since @source
  can't resolve from inside node_modules)
- setup.css: clarify in header that it's not exported or shipped
- PR title/description updated to reflect code changes, not just docs
@garrity-miepub garrity-miepub merged commit adc24d5 into main Mar 14, 2026
9 of 10 checks passed
@garrity-miepub garrity-miepub deleted the lessons/tailwind4-integration branch March 14, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants