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

Accordion: change: do animation similar to ExpansionCard #3491

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

JulianNymark
Copy link
Contributor

@JulianNymark JulianNymark commented Jan 7, 2025

Description

https://github.com/navikt/team-aksel/issues/689

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation / Decision Records
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

Copy link

changeset-bot bot commented Jan 7, 2025

⚠️ No Changeset found

Latest commit: 8449974

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Storybook demo / Chromatic

ac61890cb | 91 components | 135 stories

@JulianNymark JulianNymark marked this pull request as ready for review January 9, 2025 09:19
@JulianNymark
Copy link
Contributor Author

I did swap out inner padding with content margin (from child to parent whitespace), this made the animation work better for the box-shadow that was also moved.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like this snippet breaks after these changes, needs to be updates so that the "last" border at the bottom matches rest of the accordions

.navds-accordion__item:last-child > .navds-accordion__content

Screenshot 2025-01-17 at 12 20 03
Screenshot 2025-01-17 at 12 20 29

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah... right... i didn't try to open the last accordion element 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't see a good way around adding another div here 😞, do you see one? (if you revert this to using padding instead of margins, then you'll see the animation looks wonky for the "line" on the left (box-shadow). but adding more divs is brutish, but works.

@navikt/core/css/darkside/accordion.darkside.css Outdated Show resolved Hide resolved
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