Skip to content

fix: SCSS Import#428

Merged
ainsleyclark merged 4 commits intomainfrom
claude/fix-slug-import-error-TJ8NP
Mar 13, 2026
Merged

fix: SCSS Import#428
ainsleyclark merged 4 commits intomainfrom
claude/fix-slug-import-error-TJ8NP

Conversation

@ainsleyclark
Copy link
Contributor

No description provided.

claude added 3 commits March 13, 2026 15:58
Fixes the slug field component path from a relative `/fields/Slug/Component`
to the fully-qualified `@ainsleydev/payload-helper/fields/Slug/Component`,
preventing PayloadCMS from resolving it as a relative path in the
consumer's importMap. Also adds the corresponding package.json export.

https://claude.ai/code/session_01WVA6tqvspfT8wQrJG8Zivn
…omponent

SCSS files are not processed by SWC during build, causing a module-not-found
error for consumers importing the compiled component. Inline the minimal
styles directly to remove the dependency on the unresolved scss file.

https://claude.ai/code/session_01WVA6tqvspfT8wQrJG8Zivn
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@claude

This comment has been minimized.

@ainsleyclark ainsleyclark merged commit d171604 into main Mar 13, 2026
3 of 4 checks passed
@ainsleyclark ainsleyclark deleted the claude/fix-slug-import-error-TJ8NP branch March 13, 2026 16:27
@claude
Copy link

claude bot commented Mar 13, 2026

Review summary

  • Overall score: 7/10
  • Critical issues: 0
  • Warnings: 1
  • Suggestions: 2
  • Recommendation: Approve with comments

Small, focused fix that resolves the SCSS import path issue by inlining styles. The changeset is correct and the approach is pragmatic, though it introduces a pattern inconsistent with the rest of the project.

Critical issues

None

Warnings

Inline styles instead of a proper CSS solution

The fix replaces a dedicated SCSS file with inline style props on JSX elements. While this solves the import path problem, it introduces maintainability concerns: inline styles cannot be overridden by consumer stylesheets using class selectors, cannot be themed via CSS variables, and cannot respond to media queries. This is a regression in styling flexibility.

If the root cause is that ./index.scss failed to resolve correctly in a consumer’s importMap, a more robust solution would be to investigate why the path resolution failed rather than abandoning the SCSS approach entirely.

Suggestions

1. Consider moving styles to a global stylesheet

If SCSS imports from component files are genuinely problematic in Payload’s import map context, consider whether a scoped stylesheet at the package level (imported from the package entry point rather than the component) would work instead.

2. Retain the className on Button for consumer customisation

The original code used className='lock-button' on the Button, styled via SCSS. With the class removed, any consumer targeting .lock-button for overrides would silently break. If the class no longer carries styles, it is harmless to leave it in place as a stable customisation hook.

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