docs: add tw.style() array pattern guidance to styling rule#974
Open
georgewrmarshall wants to merge 1 commit intomainfrom
Open
docs: add tw.style() array pattern guidance to styling rule#974georgewrmarshall wants to merge 1 commit intomainfrom
georgewrmarshall wants to merge 1 commit intomainfrom
Conversation
Contributor
📖 Storybook Preview |
7 tasks
Contributor
Author
georgewrmarshall
left a comment
There was a problem hiding this comment.
Left a comment
|
|
||
| // ✅ Correct - Array pattern (matches Box component) | ||
| style={[ | ||
| tw.style('border-l-4 border-primary-default', twClassName), |
Contributor
Author
There was a problem hiding this comment.
We should be passing twClassName down to the twClassName prop not in style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extracts and documents the React Native
tw.style()array pattern from the BannerAlert migration (PR #966) into the styling cursor rule. This pattern is essential for components that need to apply Tailwind classes while accepting a customstyleprop.What is the reason for the change?
tw.style()with style props using arraysWhat is the improvement/solution?
.cursor/rules/styling.mdThis documentation was originally added as part of PR #966 but is being extracted into a standalone documentation update for better visibility and reusability.
Related issues
Related to:
Manual testing steps
.cursor/rules/styling.mdfileScreenshots/Recordings
N/A - Documentation only change
Before
No documentation for merging
tw.style()with style propsAfter
Comprehensive documentation including:
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Documentation-only change; no runtime or build behavior is modified.
Overview
Updates
.cursor/rules/styling.mdto document the React Native array pattern for combiningtw.style()output with an incomingstyleprop.Adds ✅/❌ examples, explains the rationale (type safety + explicit merge order), and includes a
BannerAlertsnippet showingstyle={[tw.style(...), style]}while passingtwClassNamethrough{...props}.Written by Cursor Bugbot for commit f1933ec. This will update automatically on new commits. Configure here.