From 5a77def2c4f123126d4a79ab02c91bbb296d3b79 Mon Sep 17 00:00:00 2001 From: Tobias Barsnes Date: Tue, 1 Oct 2024 14:47:25 +0200 Subject: [PATCH] feat(skiplink): compose sr-only class (#2546) --- .changeset/six-carrots-guess.md | 6 ++++++ packages/css/skiplink.css | 4 ++++ packages/react/src/components/SkipLink/SkipLink.tsx | 7 +------ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/six-carrots-guess.md diff --git a/.changeset/six-carrots-guess.md b/.changeset/six-carrots-guess.md new file mode 100644 index 0000000000..e6ed28e647 --- /dev/null +++ b/.changeset/six-carrots-guess.md @@ -0,0 +1,6 @@ +--- +"@digdir/designsystemet-css": patch +"@digdir/designsystemet-react": patch +--- + +SkipLink: Remove ds-sr-only class diff --git a/packages/css/skiplink.css b/packages/css/skiplink.css index 85a3b1c6e5..50d8ddf02b 100644 --- a/packages/css/skiplink.css +++ b/packages/css/skiplink.css @@ -1,3 +1,7 @@ +.ds-skiplink { + @composes ds-sr-only from './utilities.css'; +} + .ds-skiplink:focus { display: grid; place-items: center; diff --git a/packages/react/src/components/SkipLink/SkipLink.tsx b/packages/react/src/components/SkipLink/SkipLink.tsx index aa0ce378b4..d500d2f6d8 100644 --- a/packages/react/src/components/SkipLink/SkipLink.tsx +++ b/packages/react/src/components/SkipLink/SkipLink.tsx @@ -10,17 +10,12 @@ export type SkipLinkProps = { } & AnchorHTMLAttributes; export const SkipLink = ({ - href, children, className, ...rest }: SkipLinkProps): JSX.Element => { return ( - +

{children}

);