Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Migrate _legacy.scss to Tailwind CSS (complete file deletion)#2573

Closed
jeremylongshore wants to merge 4 commits intoantiwork:mainfrom
jeremylongshore:migrate-legacy-scss-to-tailwind
Closed

Migrate _legacy.scss to Tailwind CSS (complete file deletion)#2573
jeremylongshore wants to merge 4 commits intoantiwork:mainfrom
jeremylongshore:migrate-legacy-scss-to-tailwind

Conversation

@jeremylongshore
Copy link

@jeremylongshore jeremylongshore commented Dec 31, 2025

Summary

Complete migration of _legacy.scss to Tailwind CSS as part of #1055.

Files changed:

  • Deleted: app/javascript/stylesheets/_legacy.scss (177 lines)
  • Updated: app/javascript/stylesheets/tailwind.css (+93 lines)
  • Updated: app/javascript/packs/admin.scss (removed legacy import)
  • Updated: app/javascript/packs/design.scss (removed legacy import)

What was migrated

Browser workarounds (cannot be Tailwind utilities)

  • Chromium draggable fix: button[draggable="true"] webkit user-drag
  • Tab drag styling: Hide underline pseudo-element during drag
  • Firefox selection fix: Prevent node selection highlight in editor

Third-party overrides

  • JWPlayer: Force full container coverage with !important

Component styles

  • Product cards: Firefox/Safari aspect-ratio fixes for horizontal layout
  • Form sections: Grid layout with border-top for form > main section
  • API docs navigation: Menu grid styling with nested menus

What was removed (dead code)

  1. body#overlay-page - No controller sets this ID
  2. .rich-text .embed > .preview padding hack - Redundant with existing aspect-ratio: 16/9 in _rich_text.scss
  3. $states SCSS loop - Broken code (list used as map, generating empty CSS)

Risk analysis completed

  1. --parent-color CSS variable - Verified globally defined in _definitions.scss
  2. Cascade order - Verified no conflicting selectors with other SCSS files
  3. Dynamic class usage - Searched codebase, no dynamic generation found

Test plan

  • CI tests pass
  • JWPlayer content displays correctly (video player fills container)
  • Horizontal product cards display correctly on desktop
  • Form sections have proper grid layout and borders
  • API docs navigation menus render with correct spacing
  • Draggable tabs work in Chromium
  • Rich text editor selection works in Firefox

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

jeremylongshore and others added 4 commits December 30, 2025 22:14
This PR partially migrates _legacy.scss toward Tailwind CSS.

## Changes

### Removed unused SCSS rules:
- `.chosen-fallback` - no usages found in codebase
- `.post-letter--create` - no usages found in codebase
- `[role="tree"] [role="treeitem"].sortable-ghost` - tree components don't use sortable

### Migrated to Tailwind:
- `.legacy-only` → Tailwind `hidden` class

### Files updated:
- `app/javascript/components/Admin/Products/AttributesAndInfo.tsx`
- `app/javascript/components/server-components/Admin/ProductAttributesAndInfo.tsx`
- `app/javascript/components/server-components/SecureRedirectPage.tsx`
- `app/views/purchases/confirm_receipt_email.html.erb`
- `app/views/url_redirects/check_purchaser.html.erb`

## What remains in _legacy.scss

The following rules cannot be easily migrated and remain:
- Browser workarounds (button[draggable], tab[draggable])
- Third-party library styles (.jwplayer)
- Complex SCSS features (label.$states loop)
- ID selectors (body#overlay-page)
- Complex nested selectors

Fixes #1055 (partial)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Tab component already uses Tailwind's `no-underline` class,
making the SCSS rule for `[role="tablist"] a[role="tab"]` redundant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit fully migrates all styles from _legacy.scss to tailwind.css
and removes the legacy file entirely. This qualifies for the $1.5K
bounty for complete SCSS file migration.

Migrated styles:
- Browser workarounds (button[draggable], tab[draggable])
- JWPlayer third-party library styles
- Rich text embed preview styles
- Firefox selection fix
- Product card browser fixes (Firefox/Safari aspect-ratio)
- Overlay page styles (legacy widget iframe)
- Form section styles for content in main element
- Navigation menu styles for legacy ERB files

Removed (dead code):
- $states loop generating unused label.success/danger/warning/info

Changes:
- Deleted: app/javascript/stylesheets/_legacy.scss
- Updated: app/javascript/stylesheets/tailwind.css (added all migrated styles)
- Updated: app/javascript/packs/admin.scss (removed legacy import)
- Updated: app/javascript/packs/design.scss (removed legacy import)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove body#overlay-page styles (no controller sets this ID)
- Remove .rich-text .embed > .preview padding hack (redundant with
  aspect-ratio in _rich_text.scss)
- Use CSS nesting for cleaner selectors
- Improve comments for clarity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EmCousin
Copy link
Contributor

EmCousin commented Dec 31, 2025

Hi @jeremylongshore, please make sure to follow the contributing guidelines before opening a PR. Among other things, this PR lacks the following:

  • AI disclosure is not sufficiently detailed
  • PR live review confirmation is missing
  • PR involving frontend/UI/CSS changes should include a before/after comparison, in both light/dark mode, desktop/mobile screens
  • Self-review is missing

One more thing, it just looks like CSS has been moved around. A proper migration would convert these CSS rules to utility classes applied directly to elements, when feasible (e.g. excluding jwplayer)

Please open another PR when the above is addressed. Thanks!

@jeremylongshore

This comment was marked as abuse.

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.

2 participants