-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: padding and margin styles #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: c45d10c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 NPM canary releaseDeployed canary version 0.0.0-canary-a00da22. |
🏋️ Size limit report
Click here if you want to find out what is changed in this build |
🧪 Storybook is successfully deployed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates padding and margin style utilities by removing separate paddingBlock, paddingInline, marginBlock, and marginInline style modules and integrating their functionality directly into the main padding and margin style functions. This refactoring creates a unified API with proper priority handling for CSS logical properties.
Key changes:
- Removed dedicated modules for logical padding/margin properties and integrated their functionality into main style functions
- Implemented a priority system where individual directions override logical properties, which override general padding/margin
- Added comprehensive test coverage for all padding and margin functionality including edge cases
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tasty/styles/predefined.ts | Removed imports and registrations for dedicated logical property modules |
| src/tasty/styles/paddingInline.ts | Deleted dedicated paddingInline style module |
| src/tasty/styles/paddingBlock.ts | Deleted dedicated paddingBlock style module |
| src/tasty/styles/padding.ts | Refactored to handle all padding properties with priority system and helper functions |
| src/tasty/styles/padding.test.ts | Added comprehensive test coverage for unified padding functionality |
| src/tasty/styles/marginInline.ts | Deleted dedicated marginInline style module |
| src/tasty/styles/marginBlock.ts | Deleted dedicated marginBlock style module |
| src/tasty/styles/margin.ts | Refactored to handle all margin properties with priority system and helper functions |
| src/tasty/styles/margin.test.ts | Added comprehensive test coverage for unified margin functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Note
Unifies padding and margin style handling with a predictable priority system, removes separate block/inline handlers, and adds comprehensive tests.
src/tasty/styles/padding.tsandsrc/tasty/styles/margin.tswith support forstring | number | booleanacrosspadding*/margin*props.padding|margin<paddingBlock|Inline/marginBlock|Inline< individual sides, including directional values (e.g.,"2x top").autovalues; return CSS object consistently.paddingBlock.ts,paddingInline.ts,marginBlock.ts,marginInline.tsand their registrations frompredefined.ts.src/tasty/styles/padding.test.tsandsrc/tasty/styles/margin.test.tscovering base cases, directional logic, priority overrides, and edge cases.@cube-dev/ui-kitpatch – improve predictability of padding/margin style application.Written by Cursor Bugbot for commit c45d10c. This will update automatically on new commits. Configure here.