-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Svelte: compress progress indicator #62317
Conversation
Maybe you want to tackle the rest of #62306 as part of this PR? |
a35a5ac
to
9cfde63
Compare
@@ -163,7 +163,7 @@ | |||
.progress-button { | |||
border: 1px solid var(--border-color-2); | |||
border-radius: 4px; | |||
margin-left: 0.3rem; | |||
padding: 0; |
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.
Disable the default button padding so we can set it consistently without having to add paddings together
min-width: 200px; | ||
max-width: fit-content; |
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.
Got rid of the min-width and max-width because this looks better when the spacing is balanced.
justify-content: space-evenly; | ||
justify-content: space-between; |
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.
No functional difference, but since we are fitting to content, space-between is more semantically correct
@@ -37,17 +37,11 @@ | |||
</script> | |||
|
|||
<div class="indicator"> | |||
<div> |
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.
Unnecessary outer div.
width: $size; | ||
height: $size; | ||
&.inline { | ||
$inlineSize: #{(16 / 14)}em; | ||
width: $inlineSize; | ||
height: $inlineSize; | ||
|
||
vertical-align: bottom; | ||
display: inline-flex; | ||
align-items: center; | ||
} |
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.
Added the ability to specify the size of the spinner and moved the inline styling into here because the .icon-inline
styles expect to be styling an SVG.
width: $size; | ||
height: $size; | ||
&.inline { | ||
$inlineSize: #{(16 / 14)}em; |
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.
Just to avoid confuse let's not use any scss variables.
This removes some extra padding from the progress indicator and also simplifies some of the padding so it's symmetrical and doesn't rely on adding padding together to get the right layout.
Test plan
Before:
![screenshot-2024-04-30_16-58-19@2x](https://private-user-images.githubusercontent.com/12631702/327007406-d281e99e-686e-4924-b218-68a642d34e14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3NjE5NjAsIm5iZiI6MTcxODc2MTY2MCwicGF0aCI6Ii8xMjYzMTcwMi8zMjcwMDc0MDYtZDI4MWU5OWUtNjg2ZS00OTI0LWIyMTgtNjhhNjQyZDM0ZTE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE5VDAxNDc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE2MWYxNGNkMDg0Mjk5MmI5ODhiNjQ3MTc3MGYxNTM4MzMzZDQxNDQzMzU5YjNlYWZhYzYyNzkwYmZiZjU1ZWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uVtm9gq8EYYY7Ll9GKZjgV5xRW67brwhKdrHB8Mc4bY)
After:
![screenshot-2024-04-30_16-58-03@2x](https://private-user-images.githubusercontent.com/12631702/327007427-47e08d4c-da76-4dac-8da3-6f9ae43ccadb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3NjE5NjAsIm5iZiI6MTcxODc2MTY2MCwicGF0aCI6Ii8xMjYzMTcwMi8zMjcwMDc0MjctNDdlMDhkNGMtZGE3Ni00ZGFjLThkYTMtNmY5YWU0M2NjYWRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE5VDAxNDc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjOGEyZDlmZmU1ZGI4ODBiODhkMDViMWViMWNkMjM1YzNkZmNlNjY1MTE1NzBlMDU0NmE4NmQ5NTRhOWZlZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pbRgXbCU74sPhRySJ_U3yxOV9Uk8lTuipkhKYfzDA6Y)