Skip to content

Conversation

@arnest00
Copy link
Collaborator

@arnest00 arnest00 commented Apr 24, 2025

Summary of changes

  • Remove automatic link styling as buttons
  • Create button styles
  • Create button-group block

Relevant Links

Test URLs:

Checklist

  • This PR has visual changes, and has been reviewed by a designer.
  • This PR has code changes, and our linters still pass.
  • This PR has new code, so new tests were added or updated, and they pass.
  • This PR affects production code, so it was browser tested (see below).
  • The content of this PR requires documentation, so we added a detailed description of the component's purpose, requirements, quirks, and instructions for use by designers and developers. This includes accessibility information if pertinent.

Validation

  1. Visit the branch preview page
  2. Scroll down to the Button-Group section
  3. Verify the Button-Group is responsive (flex-direction: column on mobile screens, flex-direction: row on screens larger than tablet)
  4. Verify the Buttons within the group:
    a. are <a> elements with button classes applied
    b. have default, hover, and focus states
  5. Open the dev console and enter the following:
const buttonGroup = document.querySelector('div.button-group');
const newButton = document.createElement('button');
newButton.innerText = "Test Button";
newButton.classList = "button button--primary";
buttonGroup.append(newButton);
  1. Change the class of this button from button--primary to button--primary-outline, button--accent, button--static-black, button--static-white, and button--ghost through the dev console to see how the button styles look on <button> elements
  2. Force the button into a disabled state for each button style to verify inclusion
  3. Switch themes (from light mode to dark mode, or vice versa) and repeat steps 4, 6, and 7

Browser Testing

We should aim to support the latest version of the listed browsers. For older versions or other browsers not on the list, content should be accessible, even if it doesn't completely match the designs.

Developers should test as they work in the browsers available on their machines. If they have access to other devices to test other browser/OS combinations, they should do that when possible.

Windows

  • Firefox
  • Chrome
  • Edge

MacOS

  • Firefox
  • Chrome
  • Safari
  • Edge

Android

  • Firefox
  • Chrome
  • Edge

iOS

  • Safari

@arnest00 arnest00 added the WIP Work in progress, likely a draft. label Apr 24, 2025
@aem-code-sync
Copy link

aem-code-sync bot commented Apr 24, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Apr 24, 2025

Page Scores Audits Google
📱 /pattern-library/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /pattern-library/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@arnest00 arnest00 force-pushed the feat-button-group branch from 0591bad to 36855f0 Compare April 24, 2025 04:35
@aem-code-sync aem-code-sync bot temporarily deployed to feat-button-group April 24, 2025 04:35 Inactive
@arnest00 arnest00 force-pushed the feat-button-group branch from 36855f0 to 836cc5d Compare April 24, 2025 05:32
@aem-code-sync aem-code-sync bot temporarily deployed to feat-button-group April 24, 2025 05:32 Inactive
@arnest00 arnest00 force-pushed the feat-button-group branch from 836cc5d to c96456c Compare April 24, 2025 05:41
@aem-code-sync aem-code-sync bot temporarily deployed to feat-button-group April 24, 2025 05:41 Inactive
@arnest00 arnest00 changed the title wip: add button styles, create button-group block feat: add button styles, create button-group block Apr 24, 2025
@arnest00 arnest00 marked this pull request as ready for review April 24, 2025 05:45
@arnest00 arnest00 added Ready for Dev Review and removed WIP Work in progress, likely a draft. labels Apr 24, 2025
Copy link
Collaborator

@catheraaine catheraaine left a comment

Choose a reason for hiding this comment

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

Button group is great, it solves for a single button placed as a block, too, like we might need in the jobs pre-footer. I am sure you're not yet finished with documentation, but could you add a note in there that a button group can include just one button?

Some notes:

1. 😏 -webkit-font-smoothing: antialiased;

2. I think we're using the wrong blues? Visually they look different to me on both default and hover

Screenshot 2025-04-24 at 9 47 10 AM Screenshot 2025-04-24 at 9 47 40 AM

3. We'll need the static white button for over callouts, might as well build the static black one, too

Screenshot 2025-04-24 at 9 49 04 AM

anchorNode: row.children[0].firstChild.firstChild,
buttonStyle: row.children[1].firstChild,
altText: row.children[2].firstChild
}));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really like this map solve for making the components and I've stolen it for my own work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🙇

}
});
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

🪓

background-color: var(--color-background-button-hover);
cursor: pointer;
.button--primary {
--color-button-primary-background: rgb(from var(--spectrum-black) r g b / 84%);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
--color-button-primary-background: rgb(from var(--spectrum-black) r g b / 84%);
--color-button-background-primary: rgb(from var(--spectrum-black) r g b / 84%);

--color-button-primary-background: rgb(from var(--spectrum-black) r g b / 84%);
--color-button-primary-background-hover: rgb(from var(--spectrum-black) r g b / 93%);
--color-button-primary-background-disabled: rgb(from var(--spectrum-black) r g b / 9%);
--color-text-button-primary: var(--spectrum-white);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
--color-text-button-primary: var(--spectrum-white);
--color-button-text-primary: var(--spectrum-white);

or

--color-background-button-primary:

Copy link
Collaborator

Choose a reason for hiding this comment

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

since these have been moved out of global scope and into component scope, we should have the component first, methinks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I suppose if I was going to organize this in Figma or something, it'd go

--color-button-background-primary: /* ... */
--color-button-background-primary-hover: /* ... */

and so on.

--color-button-primary-background: rgb(from var(--spectrum-white) r g b / 85%);
--color-button-primary-background-hover: rgb(from var(--spectrum-white) r g b / 94%);
--color-button-primary-background-disabled: rgb(from var(--spectrum-white) r g b / 11%);
--color-text-button-primary: var(--spectrum-gray-25);
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm not going to make a million comments about cleaning up your variable names, I think you probably get it.

}
}

.button--outline {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename the button themes to match Spectrum?
https://opensource.adobe.com/spectrum-css/?path=/docs/components-button--docs

Accent, Primary, Static Black, Static White

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With the Primary having Filled and Outline variants, they should now be as follows:

  • primary
  • primary-outline
  • accent
  • static-black (added)
  • static-white (added)
  • ghost

@catheraaine catheraaine changed the title feat: add button styles, create button-group block feat: button styles and button-group Apr 24, 2025
@aem-code-sync aem-code-sync bot temporarily deployed to feat-button-group April 25, 2025 14:29 Inactive
styles/base.css Outdated
--spectrum-blue-500: rgb(142 185 252);
--spectrum-blue-800: rgb(75 117 255);
--spectrum-blue-900: rgb(59 99 251);
--spectrum-blue-1000: rgb(39, 77, 234);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a missing color from S2 feature branch

Copy link
Collaborator

@catheraaine catheraaine left a comment

Choose a reason for hiding this comment

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

Superb work, and the documentation looks great, too!

@arnest00 arnest00 merged commit 2efb9f2 into main Apr 25, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants