-
Notifications
You must be signed in to change notification settings - Fork 460
refactor(ui): migrate Mosaic Card to StyleX #9292
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
Open
austincalvelage
wants to merge
15
commits into
main
Choose a base branch
from
austin/mosaic-card-component
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ab560c8
refactor(ui): migrate Mosaic Card to StyleX
austincalvelage 4ff280b
feat(ui): align Mosaic Card with updated design
austincalvelage a45fc86
refactor(ui): align Card compound API
austincalvelage 3e5d932
feat(ui): add Card elevation variants
austincalvelage c53b67c
docs(ui): expose Card elevation controls
austincalvelage 39a52e8
feat(ui): align Card elevation variants
austincalvelage 7575e06
Merge branch 'main' into austin/mosaic-card-component
austincalvelage acd3bdd
refactor(ui): separate Card elevation styles
austincalvelage bcec0e5
Merge branch 'main' into austin/mosaic-card-component
austincalvelage 6bdcfda
refactor(ui): align Card with Mosaic component props
austincalvelage 60221b8
docs(swingset): use Card compound API in Popover examples
austincalvelage bc43056
refactor: Move ‘rest’ spread after ‘mergeStyleProps’
austincalvelage 1248e1f
refactor(ui): align Card elevation names with Figma
austincalvelage 3546d65
fix(ui): inherit Card footer background
austincalvelage f70d3bc
fix(ui): adapt Card shadows for dark mode
austincalvelage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import * as stylex from '@stylexjs/stylex'; | ||
|
|
||
| import { colorVars, radiusVars, space } from '../../tokens.stylex'; | ||
|
|
||
| export const styles = stylex.create({ | ||
| root: { | ||
| color: colorVars['--cl-color-card-foreground'], | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| rowGap: space['5'], | ||
| width: '100%', | ||
| }, | ||
| header: { | ||
| paddingInline: space['4'], | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| paddingBlockStart: space['5'], | ||
| }, | ||
| content: { | ||
| paddingInline: space['4'], | ||
| flexBasis: 'auto', | ||
| flexGrow: '1', | ||
| flexShrink: '1', | ||
| }, | ||
| footer: { | ||
| gap: space['2'], | ||
| paddingBlock: space['4'], | ||
| paddingInline: space['6'], | ||
| alignItems: 'center', | ||
| boxSizing: 'border-box', | ||
| display: 'flex', | ||
| flexShrink: 0, | ||
| justifyContent: 'space-between', | ||
| borderTopColor: colorVars['--cl-color-border'], | ||
| borderTopStyle: 'solid', | ||
| borderTopWidth: '1px', | ||
| width: '100%', | ||
| }, | ||
| }); | ||
|
|
||
| export const elevations = stylex.create({ | ||
| card: { | ||
| borderRadius: radiusVars['--cl-radius-container'], | ||
| overflow: 'hidden', | ||
| backgroundColor: colorVars['--cl-color-card'], | ||
| boxShadow: `0 12px 12px -7px light-dark(oklch(0.2046 0 0 / 12%), transparent), | ||
| 0 24px 24px -10px light-dark(oklch(0.2046 0 0 / 4%), transparent), | ||
| 0 0 0 1px light-dark(oklch(0.2046 0 0 / 4%), oklch(1 0 0 / 10%))`, | ||
| }, | ||
| flush: { | ||
| borderRadius: radiusVars['--cl-radius-container'], | ||
| overflow: 'visible', | ||
| backgroundColor: 'transparent', | ||
| boxShadow: 'none', | ||
| }, | ||
| overlay: { | ||
| borderRadius: radiusVars['--cl-radius-container'], | ||
| overflow: 'hidden', | ||
| backgroundColor: colorVars['--cl-color-card'], | ||
| boxShadow: `0 12px 12px -7px light-dark(oklch(0.2046 0 0 / 12%), transparent), | ||
| 0 24px 24px -10px light-dark(oklch(0.2046 0 0 / 4%), transparent), | ||
| 0 0 0 1px light-dark(oklch(0.2046 0 0 / 4%), oklch(1 0 0 / 10%))`, | ||
| }, | ||
| }); | ||
|
|
||
| export const headerAlignments = stylex.create({ | ||
| start: { | ||
| alignItems: 'flex-start', | ||
| textAlign: 'start', | ||
| }, | ||
| center: { | ||
| alignItems: 'center', | ||
| textAlign: 'center', | ||
| }, | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
this a placeholder for now? or a backwards compatibility thing? (noticing it mirrors raised)
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.
So in the Figma, these currently mirror each other. I'd assume these eventually would differ?
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.
cool cool. yea I'm guessing so too 🤷 . so basically just a placeholder for now I guess while a shadowing system is still tbd
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.
I think we want to move away from that
0 0 0 1px oklch(0.2046 0 0 / 4%)shadow tho.. maybe worth syncing up with @stvhayes here