Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Shrink brand before wrap #2889

Merged
merged 18 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/psammead-brand/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------- | ----------- |
| 5.1.3 | [PR#2889](https://github.com/bbc/psammead/pull/2889) Shrink brand svg before wrapping the script link |
| 5.1.2 | [PR#2928](https://github.com/bbc/psammead/pull/2928) Talos - Bump Dependencies - @bbc/psammead-script-link |
| 5.1.1 | [PR#2920](https://github.com/bbc/psammead/pull/2920) Talos - Bump Dependencies - @bbc/gel-foundations, @bbc/psammead-script-link |
| 5.1.0 | [PR#2917](https://github.com/bbc/psammead/pull/2917) Remove alpha tag from Brand component |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-brand/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/psammead-brand/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-brand",
"version": "5.1.2",
"version": "5.1.3",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ exports[`Brand should render correctly with link not provided 1`] = `
width: 100%;
max-width: 17.5rem;
min-width: 11.25rem;
-webkit-flex: 1 1 11.25rem;
-ms-flex: 1 1 11.25rem;
flex: 1 1 11.25rem;
-ms-flex-preferred-size: 17.5rem;
}
.c4:hover .c2,
Expand Down Expand Up @@ -178,6 +182,10 @@ exports[`Brand should render correctly with link provided 1`] = `
width: 100%;
max-width: 17.5rem;
min-width: 11.25rem;
-webkit-flex: 1 1 11.25rem;
-ms-flex: 1 1 11.25rem;
flex: 1 1 11.25rem;
-ms-flex-preferred-size: 17.5rem;
}
.c4 {
Expand All @@ -190,6 +198,10 @@ exports[`Brand should render correctly with link provided 1`] = `
width: 100%;
max-width: 17.5rem;
min-width: 11.25rem;
-webkit-flex: 1 1 11.25rem;
-ms-flex: 1 1 11.25rem;
flex: 1 1 11.25rem;
-ms-flex-preferred-size: 17.5rem;
}
.c2:hover .c4,
Expand Down Expand Up @@ -333,6 +345,10 @@ exports[`Brand should render correctly with no service Localised Name 1`] = `
width: 100%;
max-width: 17.5rem;
min-width: 11.25rem;
-webkit-flex: 1 1 11.25rem;
-ms-flex: 1 1 11.25rem;
flex: 1 1 11.25rem;
-ms-flex-preferred-size: 17.5rem;
}
.c4:hover .c2,
Expand Down Expand Up @@ -460,6 +476,10 @@ exports[`Brand should render correctly with transparent borders 1`] = `
width: 100%;
max-width: 17.5rem;
min-width: 11.25rem;
-webkit-flex: 1 1 11.25rem;
-ms-flex: 1 1 11.25rem;
flex: 1 1 11.25rem;
-ms-flex-preferred-size: 17.5rem;
}
.c4:hover .c2,
Expand Down
2 changes: 2 additions & 0 deletions packages/components/psammead-brand/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const brandWidth = (minWidth, maxWidth) => `
width: 100%;
max-width: ${maxWidth / 16}rem;
min-width: ${minWidth / 16}rem;
flex: 1 1 ${minWidth / 16}rem;
-ms-flex-preferred-size: ${maxWidth / 16}rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

The update to flex works well on supported browsers.
For -ms-flex-preferred-size, I looked on Browserstack with IE11 and removed this style and did not see any change in behaviour. Am I missing something 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.

image

image

This is what I see with -ms-flex-preferred-size turned off on IE11 - the script switch is off the edge of the screen.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like I had an issue with the changes in the browserstack dev tools not applying correctly. When I made changes locally I see the same as your screenshot.
So, I'm happy with the change made!

`;

const StyledLink = styled.a`
Expand Down