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-1274 BpkBreadcrumb Class 2 Overrides #3320

Merged
merged 21 commits into from
Mar 28, 2024
Merged

Conversation

jronald01
Copy link
Contributor

@jronald01 jronald01 commented Mar 26, 2024

Add existing Bpk child component overrides to wrappers.

Had to set a specific line height after adding the wrapper around the 16x16 or 32x32(zoomed) icon to retain the correct alignment, i.e. adding the wrapper increases the height of the right arrow icon which then affects the alignment of the right arrow within the breadcrumb.

Without the line height fix, the right arrows are vertically shifted up:
Screenshot 2024-03-28 at 11 37 19

With the line height fix, the right arrows are back to where they should be centrally aligned:
Screenshot 2024-03-28 at 11 39 05

  • 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

@jronald01 jronald01 added the minor Non breaking change label Mar 26, 2024
@jronald01 jronald01 changed the title BpkBreadcrumb LOOM-1274 Class 2 Overrides LOOM-1274 BpkBreadcrumb Class 2 Overrides Mar 26, 2024
Copy link

github-actions bot commented Mar 26, 2024

Browser support

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

Generated by 🚫 dangerJS against 1bd5ee6

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

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

/* After adding the wrapper around the icon, need to set the line
height to stop the 16x16 or 32x32(zoomed) icon from expanding
verically past it's 16 or 32 pixels height */
$icon-height: tokens.$bpk-line-height-xs / 2;
Copy link
Member

Choose a reason for hiding this comment

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

Given this is only used in one place does this need a whole dedicated variable just for one line further down?

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, this is because of Styelint, i.e.:
Screenshot 2024-03-28 at 12 02 28

It's fine if I am just doing:

  &__arrow {
    margin: 0 tokens.bpk-spacing-sm();
    line-height: tokens.$bpk-line-height-xs;    <<--------------
    fill: tokens.$bpk-text-disabled-day;
  }

but when I try and divide it by 2, stylelint wants a separate variable.

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 other option is I can set it to a specific pixel value of no greater than 12 pixels before the alignment starts to break again for the regular and zoomed in icon, e.g.:
line-height: 12px;

Or the other option is:
line-height: 0; which forces the element to only use the vertical space it needs.

But both will need a stylelint disable.

Or line-height: 75%, line-height: 0.75, etc.

But again, all will need stylelint disable:

42:5   ✖  Expected variable, function or keyword for "0.75" of "line-height"           scale-unlimited/declaration-strict-value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-03-28 at 12 18 10

Copy link
Member

Choose a reason for hiding this comment

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

Ok gotcha! What happens if you wrap it with brackets line-height: (tokens.$bpk-line-height-xs / 2)?

Does it still throw the warning then? If yes then ok to go with this approach

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 yeah, I actually first attached a screenshot with brackets and then I replaced it for one without the brackets:
Screenshot 2024-03-28 at 14 11 24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So with or without brackets produces the same result basically.

Copy link
Member

Choose a reason for hiding this comment

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

No worries in which case approved!

Copy link

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

@jronald01 jronald01 merged commit 24a8450 into main Mar 28, 2024
9 checks passed
@jronald01 jronald01 deleted the loom-1274_bpk-breadcrumb branch March 28, 2024 16:33
KathyWang0208 pushed a commit that referenced this pull request May 27, 2024
* BpkBreadcrumb LOOM-1274 Class 2 Overrides

* Fix Styellint issues and update snapshots

* missed tokens prefix

* fix alignment

* fix alignment 02

* fix alignment 03

* fix alignment 04

* fix icon height

* fix alignment 05

* fix alignment 06

* fix alignment 07

* fix alignment 08

* fix alignment 08

* fix alignment 09

* revert back to bpktext

* set specific icon height for regular and zoom

* set specific value that ensures percy snapshots still match

* header comment was moved slightly

---------

Co-authored-by: James Ronald <james.ronald@skyscanner.net>
KathyWang0208 pushed a commit that referenced this pull request May 27, 2024
* BpkBreadcrumb LOOM-1274 Class 2 Overrides

* Fix Styellint issues and update snapshots

* missed tokens prefix

* fix alignment

* fix alignment 02

* fix alignment 03

* fix alignment 04

* fix icon height

* fix alignment 05

* fix alignment 06

* fix alignment 07

* fix alignment 08

* fix alignment 08

* fix alignment 09

* revert back to bpktext

* set specific icon height for regular and zoom

* set specific value that ensures percy snapshots still match

* header comment was moved slightly

---------

Co-authored-by: James Ronald <james.ronald@skyscanner.net>
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

3 participants