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

Feature/rhs components #542

Merged
merged 2 commits into from
Dec 4, 2023
Merged
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
42 changes: 42 additions & 0 deletions components/skip-link/design-tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"rvo": {
"skip-link": {
"background-color": {
"css": {
"syntax": "<color>",
"inherits": true
}
},
"font-size": {
"css": {
"syntax": "<number>",
"inherits": true
}
},
"padding-block-start": {
"css": {
"syntax": "<length>",
"inherits": true
}
},
"padding-block-end": {
"css": {
"syntax": "<length>",
"inherits": true
}
},
"font-weight": {
"css": {
"syntax": "<number>",
"inherits": true
}
},
"color": {
"css": {
"syntax": "<color>",
"inherits": true
}
}
}
}
}
24 changes: 19 additions & 5 deletions components/skip-link/index.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
.rvo-skip-link {
font-weight: 700;
outline: none;
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute;
text-decoration: none;
transform: translateY(-1000%);
width: 1px;
}

.rvo-skip-link:focus {
transform: translateY(0%);
align-items: center;
background-color: var(--rvo-skip-link-background-color);
clip: auto;
color: var(--rvo-skip-link-color);
display: flex;
font-size: var(--rvo-skip-link-font-size);
font-weight: var(--rvo-skip-link-font-weight);
height: auto;
justify-content: center;
overflow: visible;
padding-block-end: var(--rvo-skip-link-padding-block-end);
padding-block-start: var(--rvo-skip-link-padding-block-start);
position: relative;
text-align: center;
width: auto;
}
10 changes: 5 additions & 5 deletions components/skip-link/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Copyright (c) 2021 Community for NL Design System
*/
import React from 'react';
import { Button } from '../button/template';
import './index.scss';
import Link from '../link/template';
import { defaultArgs } from './defaultArgs';
import './index.scss';

export interface ISkipLinkProps {
textContent?: string;
Expand All @@ -26,9 +26,9 @@ export const SkipLink: React.FC<ISkipLinkProps> = ({
anchorLink = defaultArgs.anchorLink,
}) => {
return (
<a className="rvo-skip-link" href={anchorLink}>
<Button label={textContent} />
</a>
<Link className="rvo-skip-link" href={anchorLink}>
{textContent}
</Link>
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/config/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const parameters = {
removeEmptyComments: true,
},
themes: {
default: 'ROOS 1.0',
default: 'ROOS 2.0',
target: 'root',
list: [
{ name: 'ROOS 1.0', class: 'rvo-theme', color: '#007bc7' },
Expand Down
12 changes: 12 additions & 0 deletions proprietary/design-tokens/src/components/rvo/skip-link.tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"rvo": {
"skip-link": {
"background-color": { "value": "{rvo.color.hemelblauw}" },
"font-size": { "value": "{rvo.size.lg}" },
"padding-block-start": { "value": "{rvo.size.sm}" },
"padding-block-end": { "value": "{rvo.size.sm}" },
"font-weight": { "value": "{rvo.font-weight.normal}" },
"color": { "value": "{rvo.color.wit}" }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"rvo": {
"skip-link": {
"background-color": { "value": "{rvo.color.hemelblauw}" },
"font-size": { "value": "{rvo.size.lg}" },
"padding-block-start": { "value": "{rvo.size.sm}" },
"padding-block-end": { "value": "{rvo.size.sm}" },
"font-weight": { "value": "{rvo.font-weight.normal}" },
"color": { "value": "{rvo.color.wit}" }
}
}
}
Loading