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

[LOOM-1300][BpkModalInner] Style 2 fixes #3416

Closed
wants to merge 12 commits into from
Closed

[LOOM-1300][BpkModalInner] Style 2 fixes #3416

wants to merge 12 commits into from

Conversation

metalix2
Copy link
Contributor

@metalix2 metalix2 commented May 2, 2024

Some Styling fixes to match the Designs and simplify how the styles are applied.

Remember to include the following changes:

  • Ensure the PR title includes the name of the component you are changing so it's clear in the release notes for consumers of the changes in the version e.g [KOA-123][BpkButton] Updating the colour
  • README.md (If you have created a new component)
  • Component README.md
  • Tests
  • Storybook examples created/updated
  • Type declaration (.d.ts) files updated
  • For breaking changes or deprecating components/properties, migration guides added to the description of the PR. If the guide has large changes, consider creating a new Markdown page inside the component's docs folder and link it here

Copy link

github-actions bot commented May 2, 2024

Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.tsx) were updated, but type files weren't. Have you checked that no types have changed?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against 6c67e18

Copy link

github-actions bot commented May 2, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

@metalix2 metalix2 added the minor Non breaking change label May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Comment on lines -30 to -31
margin-right: -1 * $button-padding;
margin-left: -1 * $button-padding;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We always set a margin on the button when it's not always wanted. We overrode this in the BpkModal here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's best to leave the button without a margin and allow the other componets to add one if needed.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

justify-content: center;

&--icon {
width: tokens.bpk-spacing-lg();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In figma the icon is expected to have a "Hug" of 24px Padding increasing the icon area from 16 to 24px. Though the hug is not expected on a Link that is passed.

@@ -107,7 +111,10 @@ const BpkNavigationBar = (props: Props) => {
className={getClassNames(
'bpk-navigation-bar__trailing-item',
`bpk-navigation-bar__trailing-item-${barStyle}`,
// if the Button has children safe to assume it's not an icon
!trailingButton.props?.children && 'bpk-navigation-bar__trailing-item--icon'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trailingButton prop isn't necessary an Icon it can be a Link and in that case we shouldn't set the icon style which adds the "Hug".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps the prop should be renamed to trailingItem like the Styling is? For another PR perhaps.

Comment on lines 46 to 49
&--justified {
justify-content: space-between;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For modals where the title is not centred we should justify the title to fill up the whole nav bar.

@metalix2
Copy link
Contributor Author

metalix2 commented May 3, 2024

Some expected visual changes. Fixed the NavBar height it was 0.5px to high this impacts the datepicker calendar. and Other snapshots

Screenshot 2024-05-03 at 12 01 43
Screenshot 2024-05-03 at 11 59 15
Screenshot 2024-05-03 at 11 59 21

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Comment on lines -97 to -101
&__navigation {
display: flex;
justify-content: space-between;
}

Copy link
Contributor Author

@metalix2 metalix2 May 3, 2024

Choose a reason for hiding this comment

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

Moved to the Navigation Component and created a justifed prop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have justification in side the Navigation Component. Safe to remove.

Comment on lines -107 to -125
&__close-button {
position: relative; // Override position: absolute coming from BpkNavigationBar
right: auto;

@include margins.bpk-margin-leading(tokens.bpk-spacing-base());

@include utils.bpk-rtl {
left: auto;
}

&-style--surface-contrast {
background-color: tokens.$bpk-surface-contrast-day;
color: tokens.$bpk-text-primary-dark-color;

@include utils.bpk-hover {
color: tokens.$bpk-text-primary-dark-color;
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Nav and Button components already do all this for us.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

@@ -22,13 +22,7 @@
$button-padding: tokens.bpk-spacing-sm() * 0.5;

.bpk-close-button {
width: tokens.bpk-spacing-lg();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another option is to add a prop to include the "Hug" margin.

Copy link

github-actions bot commented May 3, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Comment on lines 46 to 48
&--justified {
justify-content: space-between;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2024-05-03 at 14 10 40

Isn't this already set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! good spot removed 😅

@include typography.bpk-label-2;

&--icon {
width: tokens.bpk-spacing-lg();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Don't all the items in the bar need to be spaced out in the same way? Like why would the gap between icon --> edge be less/more than word --> edge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could remove this and have the consumers setting the icon, include it's own wrapper and classname to add width and padding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If its an icon we set a width to create padding around the Icon as shown in figma:

Screenshot 2024-05-03 at 14 32 01

Copy link

github-actions bot commented May 7, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

Copy link

github-actions bot commented May 7, 2024

Visit https://backpack.github.io/storybook-prs/3416 to see this build running in a browser.

@metalix2
Copy link
Contributor Author

metalix2 commented May 7, 2024

The main visual changes is due to fixing the nav bar height in this PR: (16 padding + 24 line-height + 16 padding = 56)
Prod:
Prod

PR:
PR

@metalix2 metalix2 marked this pull request as draft May 13, 2024 08:27
@metalix2 metalix2 closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Non breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants