From aac90c2742281a00b85b4abacab595e24e30b715 Mon Sep 17 00:00:00 2001 From: Michael Marszalek Date: Thu, 28 Sep 2023 11:18:49 +0200 Subject: [PATCH] feat(Button, Chip, Accordion): :recycle: Change components to use the same class for focus behaviour (#868) --- .../src/components/Accordion/Accordion.module.css | 14 -------------- .../Accordion/AccordionHeader/AccordionHeader.tsx | 2 ++ .../react/src/components/Button/Button.module.css | 1 - packages/react/src/components/Button/Button.tsx | 2 ++ .../components/Chip/_ChipBase/ChipBase.module.css | 9 --------- .../src/components/Chip/_ChipBase/ChipBase.tsx | 2 ++ packages/react/src/utils/utility.module.css | 3 +-- 7 files changed, 7 insertions(+), 26 deletions(-) diff --git a/packages/react/src/components/Accordion/Accordion.module.css b/packages/react/src/components/Accordion/Accordion.module.css index fcd18e92b1..0600799003 100644 --- a/packages/react/src/components/Accordion/Accordion.module.css +++ b/packages/react/src/components/Accordion/Accordion.module.css @@ -67,20 +67,6 @@ padding-left: var(--fdsc-accordion-header-padding-left); } -.header > button:focus-visible, -.header > button:focus { - --fdsc-focus-border-width: 3px; - - outline: var(--fdsc-focus-border-width) solid var(--fds-semantic-border-focus-outline); - outline-offset: var(--fdsc-focus-border-width); - box-shadow: 0 0 0 var(--fdsc-focus-border-width) var(--fds-semantic-border-neutral-strong); - border-radius: var(--fds-border_radius-interactive); -} - -.header > .button:focus:not(:focus-visible) { - outline: none; -} - @media (hover: hover) and (pointer: fine) { .header > button:hover { color: var(--fdsc-accordion-header-color-hover); diff --git a/packages/react/src/components/Accordion/AccordionHeader/AccordionHeader.tsx b/packages/react/src/components/Accordion/AccordionHeader/AccordionHeader.tsx index 6f5e917ad4..d100d78e9b 100644 --- a/packages/react/src/components/Accordion/AccordionHeader/AccordionHeader.tsx +++ b/packages/react/src/components/Accordion/AccordionHeader/AccordionHeader.tsx @@ -5,6 +5,7 @@ import React, { forwardRef, useContext } from 'react'; import { Paragraph, Heading } from '../..'; import classes from '../Accordion.module.css'; +import utilityClasses from '../../../utils/utility.module.css'; import { AccordionItemContext } from '../AccordionItem'; export type AccordionHeaderProps = { @@ -44,6 +45,7 @@ export const AccordionHeader = forwardRef< >