-
Notifications
You must be signed in to change notification settings - Fork 22
chore(Icon): migrate to CSS Modules with visual regression baseline #1050
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
76fdfc1
test(Icon): add visual regression baseline before CSS Modules migration
DreaminDani 8e04300
chore(Icon): migrate styling from styled-components to CSS Modules
DreaminDani 9f430ea
chore(Icon): move spec from tests/utils/ to tests/display/
DreaminDani 5130256
chore(Icon stories): tighten ResponsiveGridContainer typing and apply…
DreaminDani 714f8dd
chore(Icon stories): drop #888 backdrop from IconHarness
DreaminDani 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,5 @@ | ||
| --- | ||
| '@clickhouse/click-ui': patch | ||
| --- | ||
|
|
||
| Migrate Icon from styled-components to css modules with no change in behavior |
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 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,134 @@ | ||
| .svg-wrapper { | ||
| display: flex; | ||
| padding: 0; | ||
| align-items: center; | ||
| border-radius: var(--border-radii-full); | ||
| background: var(--click-icon-color-background-default); | ||
| color: var(--svg-icon-color, currentcolor); | ||
| } | ||
|
|
||
| .svg-wrapper svg { | ||
| width: var(--svg-width, var(--click-image-md-size-width)); | ||
| height: var(--svg-height, var(--click-image-md-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper :is(path[stroke], svg[stroke]:not([stroke='none']), rect[stroke], circle[fill]) { | ||
| stroke: var(--svg-icon-color, currentcolor); | ||
| } | ||
|
|
||
| .svg-wrapper :is(path[fill], svg[fill]:not([fill='none']), rect[fill], circle[fill]) { | ||
| fill: var(--svg-icon-color, currentcolor); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xs { | ||
| --svg-state-padding: var(--click-icon-space-xs-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xs svg { | ||
| width: var(--svg-width, var(--click-image-xs-size-width)); | ||
| height: var(--svg-height, var(--click-image-xs-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_size_sm { | ||
| --svg-state-padding: var(--click-icon-space-sm-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_sm svg { | ||
| width: var(--svg-width, var(--click-image-sm-size-width)); | ||
| height: var(--svg-height, var(--click-image-sm-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_size_md { | ||
| --svg-state-padding: var(--click-icon-space-md-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_md svg { | ||
| width: var(--svg-width, var(--click-image-md-size-width)); | ||
| height: var(--svg-height, var(--click-image-md-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_size_lg { | ||
| --svg-state-padding: var(--click-icon-space-lg-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_lg svg { | ||
| width: var(--svg-width, var(--click-image-lg-size-width)); | ||
| height: var(--svg-height, var(--click-image-lg-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xl { | ||
| --svg-state-padding: var(--click-icon-space-xl-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xl svg { | ||
| width: var(--svg-width, var(--click-image-xl-size-width)); | ||
| height: var(--svg-height, var(--click-image-xl-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xxl { | ||
| --svg-state-padding: var(--click-icon-space-xxl-all); | ||
| } | ||
|
|
||
| .svg-wrapper_size_xxl svg { | ||
| width: var(--svg-width, var(--click-image-xxl-size-width)); | ||
| height: var(--svg-height, var(--click-image-xxl-size-height)); | ||
| } | ||
|
|
||
| .svg-wrapper_state_success { | ||
| padding: var(--svg-state-padding, var(--click-icon-space-md-all)); | ||
| background: var(--click-icon-color-background-success); | ||
| color: var(--click-icon-color-text-success); | ||
| } | ||
|
|
||
| .svg-wrapper_state_warning { | ||
| padding: var(--svg-state-padding, var(--click-icon-space-md-all)); | ||
| background: var(--click-icon-color-background-warning); | ||
| color: var(--click-icon-color-text-warning); | ||
| } | ||
|
|
||
| .svg-wrapper_state_danger { | ||
| padding: var(--svg-state-padding, var(--click-icon-space-md-all)); | ||
| background: var(--click-icon-color-background-danger); | ||
| color: var(--click-icon-color-text-danger); | ||
| } | ||
|
|
||
| .svg-wrapper_state_info { | ||
| padding: var(--svg-state-padding, var(--click-icon-space-md-all)); | ||
| background: var(--click-icon-color-background-info); | ||
| color: var(--click-icon-color-text-info); | ||
| } | ||
|
|
||
| .svg-image { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .svg-image_size_xs { | ||
| width: var(--click-image-xs-size-width); | ||
| height: var(--click-image-xs-size-height); | ||
| } | ||
|
|
||
| .svg-image_size_sm { | ||
| width: var(--click-image-sm-size-width); | ||
| height: var(--click-image-sm-size-height); | ||
| } | ||
|
|
||
| .svg-image_size_md { | ||
| width: var(--click-image-md-size-width); | ||
| height: var(--click-image-md-size-height); | ||
| } | ||
|
|
||
| .svg-image_size_lg { | ||
| width: var(--click-image-lg-size-width); | ||
| height: var(--click-image-lg-size-height); | ||
| } | ||
|
|
||
| .svg-image_size_xl { | ||
| width: var(--click-image-xl-size-width); | ||
| height: var(--click-image-xl-size-height); | ||
| } | ||
|
|
||
| .svg-image_size_xxl { | ||
| width: var(--click-image-xxl-size-width); | ||
| height: var(--click-image-xxl-size-height); | ||
| } | ||
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,36 @@ | ||
| .responsive-grid { | ||
| gap: 1em; | ||
| grid-template-columns: repeat(6, 1fr); | ||
| } | ||
|
|
||
| /* stylelint-disable-next-line media-feature-range-notation -- prefix notation | ||
| required for browser compatibility per .browserslistrc */ | ||
| @media (max-width: 1400px) { | ||
| .responsive-grid { | ||
| grid-template-columns: repeat(4, 1fr); | ||
| } | ||
| } | ||
|
|
||
| /* stylelint-disable-next-line media-feature-range-notation -- prefix notation | ||
| required for browser compatibility per .browserslistrc */ | ||
| @media (max-width: 1100px) { | ||
| .responsive-grid { | ||
| grid-template-columns: repeat(3, 1fr); | ||
| } | ||
| } | ||
|
|
||
| /* stylelint-disable-next-line media-feature-range-notation -- prefix notation | ||
| required for browser compatibility per .browserslistrc */ | ||
| @media (max-width: 800px) { | ||
| .responsive-grid { | ||
| grid-template-columns: repeat(2, 1fr); | ||
| } | ||
| } | ||
|
|
||
| /* stylelint-disable-next-line media-feature-range-notation -- prefix notation | ||
| required for browser compatibility per .browserslistrc */ | ||
| @media (max-width: 500px) { | ||
| .responsive-grid { | ||
| grid-template-columns: 1fr; | ||
| } | ||
| } |
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.