Skip to content

Commit 4b854e6

Browse files
Add gap prop to LogoSuite (#1035)
1 parent 8a1bb23 commit 4b854e6

File tree

14 files changed

+456
-8
lines changed

14 files changed

+456
-8
lines changed

.changeset/honest-points-run.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@primer/brand-primitives': minor
3+
---
4+
5+
:warning: Breaking changes to the following design tokens:
6+
7+
```diff
8+
- --brand-LogoSuite-logobar-columnGap
9+
+ --brand-LogoSuite-logobar-columnGap-default
10+
+ --brand-LogoSuite-logobar-columnGap-condensed
11+
12+
- --brand-LogoSuite-logobar-marquee-gap
13+
+ --brand-LogoSuite-logobar-marquee-gap-default
14+
+ --brand-LogoSuite-logobar-marquee-gap-condensed
15+
16+
```

.changeset/three-lemons-cheat.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@primer/react-brand': patch
3+
---
4+
5+
Added a `gap` prop with a new `condensed` option to `LogoSuite.Logobar`.
6+
7+
```jsx
8+
<LogoSuite>
9+
<LogoSuite.Heading visuallyHidden>Heading</LogoSuite.Heading>
10+
<LogoSuite.Logobar gap="condensed">{/* ... */}</LogoSuite.Logobar>
11+
</LogoSuite>
12+
```

apps/docs/content/components/LogoSuite/react.mdx

Lines changed: 175 additions & 0 deletions
Large diffs are not rendered by default.

apps/next-docs/content/components/LogoSuite/react.mdx

Lines changed: 140 additions & 0 deletions
Large diffs are not rendered by default.

apps/next-docs/content/components/LogoSuite/react.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {PropTableValues} from '@primer/doctocat-nextjs/components'
33

44
export const LogoSuiteAlignProp = () => <PropTableValues values={['start', 'center', 'justify']} addLineBreaks />
5+
export const LogoSuiteLogobarGapProp = () => <PropTableValues values={['default', 'condensed']} addLineBreaks />
56
export const LogoSuiteLogobarVariantProp = () => <PropTableValues values={['muted', 'emphasis']} addLineBreaks />
67

78
export const LogoSuiteLogobarChildrenProp = () => (

packages/design-tokens/src/tokens/functional/components/logosuite/base.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"LogoSuite": {
33
"logobar": {
44
"columnGap": {
5-
"value": "var(--base-size-80)"
5+
"default": {
6+
"value": "var(--base-size-80)"
7+
},
8+
"condensed": {
9+
"value": "var(--base-size-40)"
10+
}
611
},
712
"rowGap": {
813
"value": "var(--base-size-40)",
@@ -20,7 +25,12 @@
2025
"value": "60s"
2126
},
2227
"gap": {
23-
"value": "var(--base-size-96)"
28+
"default": {
29+
"value": "var(--base-size-96)"
30+
},
31+
"condensed": {
32+
"value": "var(--base-size-40)"
33+
}
2434
}
2535
}
2636
}

packages/e2e/scripts/playwright/playwright.generate-tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
'components-animations-examples--timeline-bar', // animation only
116116
'components-animations--playground', // animation only
117117
'components-logosuite-examples--following-hero', // animation only
118+
'components-logosuite-features--condensed-gap', // animation only
118119
'components-logosuite-features--marquee', // animation only
119120
'components-logosuite-features--slower-marquee-speed', // animation only
120121
'components-logosuite-features--mixed-width', // animation only

packages/react/src/LogoSuite/LogoSuite.features.stories.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ export const WithoutDivider = () => (
9292
</Grid>
9393
)
9494

95+
export const CondensedGap = () => (
96+
<Grid>
97+
<Grid.Column>
98+
<LogoSuite>
99+
<LogoSuite.Heading visuallyHidden>Heading</LogoSuite.Heading>
100+
<LogoSuite.Logobar gap="condensed">{logos.slice(0, 6)}</LogoSuite.Logobar>
101+
</LogoSuite>
102+
<LogoSuite>
103+
<LogoSuite.Heading visuallyHidden>Heading</LogoSuite.Heading>
104+
<LogoSuite.Logobar gap="condensed" marquee>
105+
{logos.slice(0, 12)}
106+
</LogoSuite.Logobar>
107+
</LogoSuite>
108+
</Grid.Column>
109+
</Grid>
110+
)
111+
95112
export const Marquee = () => (
96113
<LogoSuite>
97114
<LogoSuite.Heading visuallyHidden>Heading</LogoSuite.Heading>

packages/react/src/LogoSuite/LogoSuite.module.css

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@
2727
display: flex;
2828
flex-wrap: wrap;
2929
row-gap: var(--brand-LogoSuite-logobar-rowGap);
30-
column-gap: var(--brand-LogoSuite-logobar-columnGap);
3130
justify-content: center;
3231
}
3332

33+
.LogoSuite__logobar--gap-default {
34+
--marquee-gap: var(--brand-LogoSuite-logobar-marquee-gap-default);
35+
column-gap: var(--brand-LogoSuite-logobar-columnGap-default);
36+
}
37+
38+
.LogoSuite__logobar--gap-condensed {
39+
--marquee-gap: var(--brand-LogoSuite-logobar-marquee-gap-condensed);
40+
column-gap: var(--brand-LogoSuite-logobar-columnGap-condensed);
41+
}
42+
3443
.LogoSuite:not(.LogoSuite + .LogoSuite)
3544
.LogoSuite__heading:not(.LogoSuite__heading--visually-hidden)
3645
+ .LogoSuite__logobar,
@@ -113,7 +122,7 @@
113122
display: flex;
114123
align-items: center;
115124
justify-content: space-around;
116-
gap: var(--brand-LogoSuite-logobar-marquee-gap);
125+
gap: var(--marquee-gap);
117126
min-width: 100%;
118127
animation-name: LogobarScrollX;
119128
animation-duration: var(--brand-LogoSuite-logobar-marquee-default);
@@ -137,7 +146,7 @@
137146
transform: translateX(0);
138147
}
139148
to {
140-
transform: translateX(calc(-100% - var(--brand-LogoSuite-logobar-marquee-gap)));
149+
transform: translateX(calc(-100% - var(--marquee-gap)));
141150
}
142151
}
143152

@@ -149,7 +158,7 @@
149158
display: flex;
150159
overflow: hidden;
151160
user-select: none;
152-
gap: var(--brand-LogoSuite-logobar-marquee-gap);
161+
gap: var(--marquee-gap);
153162
width: calc(100% - var(--base-size-40));
154163
-webkit-mask-image: linear-gradient(
155164
to right,

packages/react/src/LogoSuite/LogoSuite.module.css.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ declare const styles: {
88
readonly "LogoSuite__heading": string;
99
readonly "LogoSuite__heading--visually-hidden": string;
1010
readonly "LogoSuite__logobar": string;
11+
readonly "LogoSuite__logobar--gap-condensed": string;
12+
readonly "LogoSuite__logobar--gap-default": string;
1113
readonly "LogoSuite__logobar--has-marquee": string;
1214
readonly "LogoSuite__logobar--paused": string;
1315
readonly "LogoSuite__logobar--variant-emphasis": string;

0 commit comments

Comments
 (0)