-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix: Implement Custom Style Hook for Card component #33912
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
Merged
khmakoto
merged 18 commits into
microsoft:master
from
terynk:card-component-custom-style-hook-unstable
Mar 6, 2025
Merged
Fix: Implement Custom Style Hook for Card component #33912
khmakoto
merged 18 commits into
microsoft:master
from
terynk:card-component-custom-style-hook-unstable
Mar 6, 2025
Conversation
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
Pull request demo site: URL |
mltejera
reviewed
Feb 26, 2025
packages/react-components/react-card/library/src/components/CustomHooks/index.ts
Outdated
Show resolved
Hide resolved
…ithub.com/terynk/fluentui into card-component-custom-style-hook-unstable
packages/react-components/react-card/library/src/components/CardFooter/CardFooter.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Owen Campbell <ocampbell95@gmail.com>
📊 Bundle size reportUnchanged fixtures
|
mltejera
reviewed
Feb 28, 2025
change/@fluentui-react-card-7fc24491-6b02-436b-8f94-650824f19639.json
Outdated
Show resolved
Hide resolved
mltejera
reviewed
Feb 28, 2025
packages/react-components/react-card/stories/src/Card/CardDefault.stories.tsx
Outdated
Show resolved
Hide resolved
@tudorpopams, @gouttierre if we could prioritize this PR that would be helpful. |
marcosmoura
reviewed
Mar 5, 2025
packages/react-components/react-card/stories/src/Card/CardDefault.stories.tsx
Show resolved
Hide resolved
mltejera
approved these changes
Mar 5, 2025
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.
Looks solid to me assuming we remove the stories 🤜🤛
…ithub.com/terynk/fluentui into card-component-custom-style-hook-unstable
marcosmoura
approved these changes
Mar 6, 2025
marcosmoura
approved these changes
Mar 6, 2025
khmakoto
approved these changes
Mar 6, 2025
1 task
mainframev
pushed a commit
to mainframev/fluentui
that referenced
this pull request
Jun 9, 2025
Co-authored-by: terynkum <terynkum@microsoft.com> Co-authored-by: Owen Campbell <ocampbell95@gmail.com>
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.
Old Behavior
Users were unable to apply Custom Style Hooks to Card, CardHeader, CardFooter, and CardPreview.
New Behavior
Users can now apply Custom Style Hooks to Card, CardHeader, CardFooter, and CardPreview. The screen shots below show test cases for each component that demonstrate the ability to apply Custom Hooks. In each Custom Hook, the backgroundColor of the component was updated to tokens.colorNeutralBackground3. The test code will be removed but can be found in commits 03817b9 and 65d20ca. The test code applies Custom Style Hooks to the Default styling of each component.
Test Screenshots
Default styling can be found under each subpage on the Fluent V9 Website The test code making the background red will be REMOVED. THIS IS FOR TESTING PURPOSES ONLY.
Card

CardFooter

CardHeader

CardPreview

Note: Changed padding in addition to backgroundColor because preview image covered the entire background so users were unable to see the red.