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

fix: icons shrinking when in a flex context #130

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

carlmw
Copy link
Contributor

@carlmw carlmw commented Mar 15, 2024

How to review this PR

Leave this text block for the reviewer

  • Check component hierarchy is followed correctly
  • Check the design Heuristics have been followed
  • Check naming conventions have been applied
  • Check for these gotchyas:
    • Missing exports for Oak components
    • Accidental export of Internal components
    • Snapshots of unexpected components have been modified
    • Circular dependencies
    • Code duplication (via not using base components)
    • Non-functional storybook for this or related components
    • Sensitve files changed eg. atoms, or style tokens
    • Relative imports
    • Default exports

Description

This is a common bug where an icon is a direct descendent of a flex container it would shrink according to the flex algorithm — this change sets the min height and width to match the width and height ensuring that this won't happen.

We can reasonably expect that in all cases the icon shrinking would not be intentional and that we would expect to set the dimensions responsively when necessary for different breakpoints.

Before
Screenshot 2024-03-15 at 10 20 41

After
Screenshot 2024-03-15 at 10 20 51

A link to the component in the deployment preview

https://deploy-preview-130--lively-meringue-8ebd43.netlify.app/?path=/docs/components-atoms-oakicon--docs
https://deploy-preview-130--lively-meringue-8ebd43.netlify.app/?path=/docs/components-molecules-oakdraggable--docs

Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for lively-meringue-8ebd43 ready!

Name Link
🔨 Latest commit f653160
🔍 Latest deploy log https://app.netlify.com/sites/lively-meringue-8ebd43/deploys/65f42d618e088b00081c4aae
😎 Deploy Preview https://deploy-preview-130--lively-meringue-8ebd43.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@carlmw carlmw force-pushed the fix/draggable-icon-shrinking branch from b6f6438 to 4b5f06a Compare March 15, 2024 10:44
@carlmw carlmw changed the title fix: the icon in OakDraggable flexing down when the text is long fix: icons shrinking when in a flex context Mar 15, 2024
@carlmw carlmw marked this pull request as ready for review March 15, 2024 10:49
we'll always want precise control over the dimensions of the icon, so we'll
use min-width and min-height to prevent it from shrinking when in a flex container
@carlmw carlmw force-pushed the fix/draggable-icon-shrinking branch from 4b5f06a to f653160 Compare March 15, 2024 11:13
Copy link
Contributor

@rightsaidjames rightsaidjames left a comment

Choose a reason for hiding this comment

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

Looks good - I tested the OakQuizOrder - With Many Options component at multiple breakpoints and confirmed that the sizing stayed consistent.

@carlmw carlmw merged commit c0569f6 into main Mar 18, 2024
5 checks passed
@carlmw carlmw deleted the fix/draggable-icon-shrinking branch March 18, 2024 15:14
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