Skip to content
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

Use CSS grid for services dropdown #242

Merged
merged 9 commits into from
Dec 13, 2024
Merged

Conversation

maxschmeling
Copy link
Contributor

@maxschmeling maxschmeling commented Dec 13, 2024

This got accidentally left out of the last PR merge. It just uses CSS grid instead of flex to make the services menu more consistent for different sizes of text.

image

@maxschmeling maxschmeling force-pushed the update/services-menu-style branch from 9812b18 to 5975847 Compare December 13, 2024 21:55
Comment on lines 114 to 115
align-items: flex-start;
align-content: flex-start;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smallest nit ever, we could change flex-start to start

src/settings/index.scss Outdated Show resolved Hide resolved
@maxschmeling
Copy link
Contributor Author

Made a small update to align the content of the buttons to start so the icons line up, while still having the button fill the full row and look better on hover / when focused.
image

@brookewp
Copy link
Contributor

Made a small update to align the content of the buttons to start so the icons line up, while still having the button fill the full row and look better on hover / when focused.

I agree that the icons look better lined up, but the hover background over HTTP looks a bit awkward. What about if we just wrap the text for Salesforce and use space-around or space-evenly?

space-around
Screenshot 2024-12-13 at 2 37 20 PM

diff --git a/src/settings/index.scss b/src/settings/index.scss
index 80451a5..f05db0e 100644
--- a/src/settings/index.scss
+++ b/src/settings/index.scss
@@ -121,7 +121,7 @@ body {
 			}
 
 			.components-button.has-icon.has-text {
-				height: 100%;
+				height: 101px;
 				display: flex;
 				width: 112px;
 				padding: var(--Spacing-Spacing-Base, 16px);
@@ -130,7 +130,7 @@ body {
 				gap: 12px;
 				align-self: stretch;
 				justify-self: stretch;
-				justify-content: start;
+				justify-content: space-around;
 
 				&:hover {
 					color: unset;
@@ -141,13 +141,21 @@ body {
 				.components-menu-item__item {
 					min-width: unset;
 					margin-right: unset;
-					text-wrap: auto;
 					text-align: center;
 				}
 			}
 
-			.rdb-settings-page_add-data-source-btn-salesforce-b2c svg {
-				width: 50px;
+			.components-button.has-icon.has-text.rdb-settings-page_add-data-source-btn-salesforce-b2c {
+
+				svg {
+					width: 50px;
+				}
+
+				span.components-menu-item__item {
+					text-wrap: auto;
+					min-width: 112px;
+				}
+
 			}
 		}
 	}

or space-evenly

Screenshot 2024-12-13 at 2 37 32 PM

Signed-off-by: brookewp <brooke.kaminski@automattic.com>
Signed-off-by: brookewp <brooke.kaminski@automattic.com>
Signed-off-by: brookewp <brooke.kaminski@automattic.com>
Signed-off-by: brookewp <brooke.kaminski@automattic.com>
Signed-off-by: brookewp <brooke.kaminski@automattic.com>
@brookewp
Copy link
Contributor

brookewp commented Dec 13, 2024

I looked back at the designs and noticed the icons were a bit bigger which helps with the alignment. So I've updated the PR to match:

Figma PR
Screenshot 2024-12-13 at 3 30 31 PM Screenshot 2024-12-13 at 3 49 43 PM

Edited PR screenshot to include active button color change and size: 4d0eb98 (#242)

Signed-off-by: brookewp <brooke.kaminski@automattic.com>
@brookewp brookewp merged commit 6a13981 into trunk Dec 13, 2024
9 checks passed
@brookewp brookewp deleted the update/services-menu-style branch December 13, 2024 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants