Skip to content

Add big tab accordion variant#550

Merged
RitwikSrivastava merged 5 commits intomainfrom
tabsacc
Mar 19, 2025
Merged

Add big tab accordion variant#550
RitwikSrivastava merged 5 commits intomainfrom
tabsacc

Conversation

@RitwikSrivastava
Copy link
Copy Markdown
Collaborator

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):

Fix #533

Test URLs:

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync bot commented Mar 10, 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
Copy Markdown

aem-code-sync bot commented Mar 10, 2025

Page Scores Audits Google
📱 /drafts/import-02-24/supported-devices PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /drafts/import-02-24/supported-devices PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link
Copy Markdown
Collaborator

@helms-charity helms-charity left a comment

Choose a reason for hiding this comment

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

In addition to my inline comments, can you also fix this bug:

  • at accordion.css line 18, remove "width: 100%" since it is not needed for either type of accordion. This will fix the first down arrow item from being narrower than all the rest.

The biggest problem is content being cut off in mobile.

/* Additional spacing for larger screens */
@media (width >= 992px) {
.tabs.big .accordion-wrapper {
padding: 0 4rem;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove this at line 345 to make the spacing match the original better.

color: #454550;
font-weight: bold;
text-transform: uppercase;
font-size: 20px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Live site has smaller font in mobile. Change 317 to
font-size: 16px;
Then add font-size: 20px for width > 768px.

}

/* "big" variant */
.tabs.big .tabs-list button {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can remove lines 277-280 because the font and spacing in your version compared to the live.


/* stylelint-disable-next-line no-descending-specificity */
.tabs.big .tabs-list button p {
font-size: 1.25rem;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove line 284, to keep the original font size here.

order: 2; /* Move arrow to end */
margin: 4px 0 0 2rem; /* Adjust margins for right alignment */
position: absolute;
right: 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you also add background: url here to use the larger "V" style icon like the original? (I see we have the white version of that in the mobile footer).

.tabs.big .accordion-wrapper {
max-width: 1200px;
margin: 2rem auto;
padding: 0 2rem;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Change lines 288-292 to:

.tabs.big .accordion-wrapper {
max-width: 1130px;
margin: 1rem auto;
padding: 0 1rem;
}

to better match the live version


.tabs.big .accordion .details .accordion-item-body {
font-size: 1.125rem;
padding-left: 4rem;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Replace line 320-324 with the below to better match the live site (don't need font-size here).

.tabs.big .accordion .details .accordion-item-body {
padding-left: 0;
line-height: 1.5;
}

height: 128px;
object-fit: contain;
display: block;
margin: 1rem 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove margin at line 355

/* stylelint-disable-next-line no-descending-specificity */
.tabs.big .accordion .details .accordion-item-body picture img {
width: 128px;
height: 128px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know how best to fix this, but because there is a JS calculated max-height on the .accordion-item-body, having the height: 128px on the image is pushing the bottom of the text out of the visible area.
image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This happens when we responsively change width of screen. but not if directly opened on mobile device.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks -- I think that is acceptable.

Copy link
Copy Markdown
Collaborator

@helms-charity helms-charity left a comment

Choose a reason for hiding this comment

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

Just reverse the arrow direction and you can merge, everything else looks good.

position: absolute;
right: 9px;
top: 50%;
transform: translateY(-50%) rotate(-135deg);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make this rotate(45deg)


/* Rotate arrow when accordion is open */
.tabs.big .accordion .details.open .summary::before {
transform: translateY(-50%) rotate(45deg);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make this rotate(-135deg) and then it will match the position of the mobile footer accordion arrow positions.

/* stylelint-disable-next-line no-descending-specificity */
.tabs.big .accordion .details .accordion-item-body picture img {
width: 128px;
height: 128px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks -- I think that is acceptable.

@RitwikSrivastava RitwikSrivastava merged commit 74c8924 into main Mar 19, 2025
2 checks passed
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.

[Import] Create a new tabs accordion variant

2 participants