This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Brand should have max width of 80rem #649
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5b707f5
Give brand SVG max-width of 80rem
f2b4e92
Update snapshots.
d61bfb5
Update package.json, CHANGELOG.md
f08f5e1
Fix max-width not being applied to brand with link.
ac2a448
Update snapshots.
d631719
Merge branch 'latest' of github.com:bbc/psammead into 645-brand-shoul…
9ffdbc1
Update package-lock.json.
8f875cd
Merge branch 'latest' of github.com:bbc/psammead into 645-brand-shoul…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,10 @@ import styled from 'styled-components'; | |
import { string, number, node, shape } from 'prop-types'; | ||
import { C_POSTBOX, C_WHITE } from '@bbc/psammead-styles/colours'; | ||
import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text'; | ||
import { GEL_GROUP_3_SCREEN_WIDTH_MIN } from '@bbc/gel-foundations/breakpoints'; | ||
import { | ||
GEL_GROUP_3_SCREEN_WIDTH_MIN, | ||
GEL_GROUP_4_SCREEN_WIDTH_MAX, | ||
} from '@bbc/gel-foundations/breakpoints'; | ||
import { | ||
GEL_SPACING_HLF, | ||
GEL_SPACING, | ||
|
@@ -19,6 +22,11 @@ const PADDING_AROUND_SVG_BELOW_600PX = 32; | |
const conditionallyRenderHeight = (svgHeight, padding) => | ||
svgHeight ? `height: ${(svgHeight + padding) / 16}rem` : ''; | ||
|
||
const SvgWrapper = styled.div` | ||
max-width: ${GEL_GROUP_4_SCREEN_WIDTH_MAX}; | ||
margin: 0 auto; | ||
`; | ||
|
||
const Banner = styled.div` | ||
background-color: ${C_POSTBOX}; | ||
${({ svgHeight }) => | ||
|
@@ -100,18 +108,20 @@ const StyledBrand = ({ | |
<Fragment> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this doesnt work when the svg is a link weirdly :P May need to move the wrapper up a bit |
||
{svg && ( | ||
<Fragment> | ||
<BrandSvg | ||
height={svgHeight} | ||
viewBox={`0 0 ${svg.viewbox.width} ${svg.viewbox.height}`} | ||
xmlns="http://www.w3.org/2000/svg" | ||
focusable="false" | ||
aria-hidden="true" | ||
ratio={svg.ratio} | ||
maxWidth={maxWidth} | ||
minWidth={minWidth} | ||
> | ||
{svg.group} | ||
</BrandSvg> | ||
<SvgWrapper> | ||
<BrandSvg | ||
height={svgHeight} | ||
viewBox={`0 0 ${svg.viewbox.width} ${svg.viewbox.height}`} | ||
xmlns="http://www.w3.org/2000/svg" | ||
focusable="false" | ||
aria-hidden="true" | ||
ratio={svg.ratio} | ||
maxWidth={maxWidth} | ||
minWidth={minWidth} | ||
> | ||
{svg.group} | ||
</BrandSvg> | ||
</SvgWrapper> | ||
<VisuallyHiddenText> | ||
<LocalisedBrandName | ||
product={product} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though they are the same value 🙈 Can you use
GEL_GROUP_5_SCREEN_WIDTH_MIN
here instead please :P Its what we used before :)