Skip to content

Commit

Permalink
FEAT: different style options added to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeriRoijenga committed Oct 15, 2024
1 parent ea86509 commit e670162
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
15 changes: 15 additions & 0 deletions packages/components-css/footer/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,27 @@
--utrecht-heading-4-color: currentColor;
--utrecht-heading-5-color: currentColor;
--utrecht-heading-6-color: currentColor;
--utrecht-page-footer-background-color: var(--rhc-color-robijnrood-500);
--utrecht-page-footer-color: var(--rhc-color-wit);

column-gap: var(--rhc-page-footer-column-gap);
display: flex;
flex-direction: row;
}

.rhc-footer--filled-secondary {
--utrecht-page-footer-background-color: var(--rhc-color-lintblauw-500);
}

.rhc-footer--outlined {
--utrecht-page-footer-background-color: var(--rhc-color-wit);
--utrecht-page-footer-color: var(--rhc-color-lintblauw-500);

border-block-start-color: var(--rhc-page-footer-border-block-start-color);
border-block-start-style: var(--rhc-page-footer-border-block-start-style);
border-block-start-width: var(--rhc-page-footer-border-block-start-width);
}

.rhc-page-footer__section {
break-inside: avoid;
}
Expand Down
14 changes: 12 additions & 2 deletions packages/components-react/src/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface FooterProps extends PageFooterProps {
heading: ReactNode;
headingLevel: number;
columns?: IColumn[];
background?: 'filled-primary' | 'filled-secondary' | 'outlined';
}

interface IColumn {
Expand All @@ -18,10 +19,18 @@ const MAX_HEADING_LEVEL = 6;

export const Footer = forwardRef(
(
{ className, heading, columns, headingLevel, children, ...restProps }: PropsWithChildren<FooterProps>,
{ className, heading, columns, headingLevel, children, background, ...restProps }: PropsWithChildren<FooterProps>,
ref: ForwardedRef<HTMLDivElement>,
) => (
<UtrechtPageFooter {...restProps} className={clsx('rhc-footer', className)} ref={ref}>
<UtrechtPageFooter
{...restProps}
ref={ref}
className={clsx(
'rhc-footer',
background === 'filled-secondary' || background === 'outlined' ? `rhc-footer--${background}` : '',
className,
)}
>
{heading && (
<Heading className="rhc-footer__title" level={headingLevel}>
{heading}
Expand All @@ -47,4 +56,5 @@ export const Footer = forwardRef(
</UtrechtPageFooter>
),
);

Footer.displayName = 'Footer';
1 change: 1 addition & 0 deletions packages/storybook/src/community/footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const DefaultFooter: Story = {
args: {
heading: 'De Rijksoverheid. Voor Nederland',
headingLevel: 4,
background: 'filled-primary',
columns: [
{
heading: 'Service',
Expand Down
16 changes: 16 additions & 0 deletions proprietary/design-tokens/figma/figma.tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,22 @@
"type": "spacing"
}
}
},
"border": {
"block-start": {
"width": {
"value": "{rhc.border-width.m}",
"type": "borderWidth"
},
"color": {
"value": "{rhc.color.robijnrood.500}",
"type": "color"
},
"style": {
"value": "solid",
"type": "borderStyle"
}
}
}
}
}
Expand Down

0 comments on commit e670162

Please sign in to comment.