-
Notifications
You must be signed in to change notification settings - Fork 614
Cleanup styled-components in *.stories.tsx files and convert to CSS modules #6197
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
Copilot
wants to merge
10
commits into
main
Choose a base branch
from
copilot/fix-6196
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.
+176
−119
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38833a7
Initial plan for issue
Copilot 9097ef3
Replace styled-components with CSS modules in ActionList, ActionMenu,…
Copilot 8332b24
Complete styled-components cleanup in all remaining story files
Copilot 5412c12
Remove CSS layers and replace Box components with div elements
Copilot 87a0c94
Refactor CSS styles for consistency and clarity across components
jonrohan 420f132
Fix issues identified in code review comments
Copilot 0e8274c
Merge branch 'main' into copilot/fix-6196
francinelucca f05f7d9
Fix ErsatzOverlay CSS custom property to always set max-width value
Copilot ccdd42d
Revert commit f05f7d9 - restore conditional CSS custom property setting
Copilot 901eb8b
Convert ThemeProvider inline style to CSS modules with :global syntax
Copilot 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.ResizableContainer { | ||
/* stylelint-disable-next-line color-named */ | ||
outline: 1px solid black; | ||
overflow: auto; | ||
padding: var(--base-size-4); | ||
resize: horizontal; | ||
/* stylelint-disable-next-line primer/responsive-widths */ | ||
width: 600px; | ||
} |
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
42 changes: 42 additions & 0 deletions
42
packages/react/src/stories/AnchoredPositionStories.module.css
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,42 @@ | ||
.Float { | ||
position: absolute; | ||
border: var(--borderWidth-thin) solid var(--borderColor-default); | ||
border-radius: var(--borderRadius-medium); | ||
background-color: var(--bgColor-attention-muted); | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
font-size: var(--text-body-size-medium); | ||
font-weight: var(--base-text-weight-semibold); | ||
padding: var(--base-size-16); | ||
} | ||
|
||
.Anchor { | ||
position: absolute; | ||
border: var(--borderWidth-thin) solid var(--borderColor-default); | ||
border-radius: var(--borderRadius-medium); | ||
background-color: var(--bgColor-accent-muted); | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
font-size: var(--text-body-size-medium); | ||
font-weight: var(--base-text-weight-semibold); | ||
padding: var(--base-size-16); | ||
} | ||
|
||
.Nav { | ||
width: 300px; | ||
padding: var(--base-size-16); | ||
position: relative; | ||
overflow: hidden; | ||
border-right: var(--borderWidth-thin) solid var(--borderColor-default); | ||
} | ||
|
||
.Main { | ||
display: flex; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
} |
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,5 @@ | ||
.MarginButton { | ||
margin: var(--base-size-8) 0; | ||
} | ||
|
||
/* Helper styles for focus trap visual aids */ |
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,3 @@ | ||
.MarginButton { | ||
margin: var(--base-size-8); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:global(body) { | ||
background-color: var(--bgColor-default); | ||
} |
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
18 changes: 18 additions & 0 deletions
18
packages/react/src/stories/deprecated/ActionListStories.module.css
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,18 @@ | ||
.ErsatzOverlay { | ||
border-radius: var(--borderRadius-large); | ||
/* stylelint-disable primer/box-shadow */ | ||
box-shadow: | ||
0 1px 3px rgba(0, 0, 0, 0.12), | ||
0 8px 24px rgba(149, 157, 165, 0.2); | ||
/* stylelint-enable primer/box-shadow */ | ||
overflow: hidden; | ||
} | ||
|
||
.ErsatzOverlay[data-max-width] { | ||
max-width: var(--ersatz-overlay-max-width); | ||
} | ||
|
||
.StyledDivWithWhiteFill > svg { | ||
/* stylelint-disable-next-line color-named */ | ||
fill: white; | ||
} |
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
8 changes: 8 additions & 0 deletions
8
packages/react/src/stories/deprecated/ActionMenuStories.module.css
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,8 @@ | ||
/* stylelint-disable primer/box-shadow */ | ||
.ErsatzOverlay { | ||
border-radius: var(--borderRadius-large); | ||
box-shadow: | ||
0 1px 3px rgba(0, 0, 0, 0.12), | ||
0 8px 24px rgba(149, 157, 165, 0.2); | ||
padding: var(--base-size-8); | ||
} |
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.
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.
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.
The suggestion as written would cause a TypeScript error since
'none'
(string) is not assignable toCSSProperties | undefined
. I interpreted the intent and fixed it to always set the CSS custom property, defaulting to'none'
when no maxWidth is provided, which properly replicates the original styled-component behavior. (f05f7d9)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.
@copilot This may make the attribute
style="none"
? Is that valid?