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

Adjust spacing in river breakout #883

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .changeset/nasty-boxes-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@primer/react-brand': patch
---

Visual spacing updates to `RiverBreakout`

- Reduced vertical gap between the main text and link.
- Applied a maximum width to the main text.
9 changes: 9 additions & 0 deletions .changeset/strong-eels-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@primer/brand-primitives': patch
---

Added new token for river breakout vertical spacing:

```
--brand-River-spacing-innerY
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
}
}
},
"innerY": {
"value": "var(--base-size-24)",
"responsive": {
"768px": {
"value": "var(--base-size-24)"
},
"1280px": {
"value": "var(--base-size-32)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@danielguillan @jesussandreas For breakout vertical spacing, i only have a reference point for desktop. Left mobile and tablets at 24px as before. Let me know if you feel it should also change.

}
}
},
"outer": {
"value": "var(--base-size-36)",
"responsive": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 49 additions & 47 deletions packages/react/src/river/RiverBreakout/RiverBreakout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import React from 'react'
import {Meta, StoryFn} from '@storybook/react'
import {RiverBreakout} from '.'
import {Link, Text, Timeline} from '../../'
import {Container} from '../../component-helpers'
import {Grid, Link, Text, Timeline} from '../../'
import placeholderImage from '../../fixtures/images/placeholder-600x400.png'

export default {
title: 'Components/RiverBreakout',
component: RiverBreakout,
decorators: [
Story => (
<Grid>
<Grid.Column>
<Story />
</Grid.Column>
</Grid>
),
],
} as Meta<typeof RiverBreakout>

const TrailingTimeline = () => (
Expand All @@ -26,55 +34,49 @@ const PlaceholderImage = () => (
)

export const Default: StoryFn<typeof RiverBreakout> = () => (
<Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>Accelerate workflows</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content trailingComponent={TrailingTimeline}>
<Text>
Accelerate your workflows and scale your business fast with access to millions of open source projects on
GitHub, the largest source code host.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
</Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>Accelerate workflows</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content trailingComponent={TrailingTimeline}>
<Text>
Accelerate your workflows and scale your business fast with access to millions of open source projects on
GitHub, the largest source code host.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
)

export const HighlightedPortion: StoryFn<typeof RiverBreakout> = () => (
<Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>River breakout highlight</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content trailingComponent={TrailingTimeline}>
<Text>
<b>This first sentence is a river breakout headline.</b> And this is where the body copy starts. Remember to
keep these nice and succinct.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
</Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>River breakout highlight</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content trailingComponent={TrailingTimeline}>
<Text>
<b>This first sentence is a river breakout headline.</b> And this is where the body copy starts. Remember to
keep these nice and succinct.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
)

export const WithoutTrailingComponent: StoryFn<typeof RiverBreakout> = () => (
<Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>Accelerate workflows</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content>
<Text>
Accelerate your workflows and scale your business fast with access to millions of open source projects on
GitHub, the largest source code host.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
</Container>
<RiverBreakout>
<RiverBreakout.A11yHeading>Accelerate workflows</RiverBreakout.A11yHeading>
<RiverBreakout.Visual>
<PlaceholderImage />
</RiverBreakout.Visual>
<RiverBreakout.Content>
<Text>
Accelerate your workflows and scale your business fast with access to millions of open source projects on
GitHub, the largest source code host.
</Text>
<Link href="#">Call to action</Link>
</RiverBreakout.Content>
</RiverBreakout>
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/react/src/river/river-shared.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
}

.RiverBreakout .River__text {
max-width: 37.5rem; /* 600px */
color: var(--brand-color-text-default);
font-size: var(--brand-text-size-500);
font-weight: var(--brand-heading-weight-500);
Expand Down Expand Up @@ -176,6 +177,7 @@
.RiverBreakout .River__content {
display: grid;
gap: var(--brand-River-spacing-inner);
row-gap: var(--brand-River-spacing-innerY);
grid-template-areas:
'text trailingComponent'
'cta trailingComponent';
Expand Down
Loading