Skip to content

Commit 86bf15f

Browse files
committed
fix(tab): indicate focus on Tab
1 parent 0f34f44 commit 86bf15f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/components/Tab/Tab.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import propTypes from 'prop-types';
33

44
import styled from 'styled-components';
5-
import { createBorderStyles, createBoxStyles } from '../common';
5+
import { createBorderStyles, createBoxStyles, focusOutline } from '../common';
66
import { blockSizes, padding } from '../common/system';
77

88
const StyledTab = styled.button`
@@ -23,7 +23,16 @@ const StyledTab = styled.button`
2323
cursor: default;
2424
color: ${({ theme }) => theme.text};
2525
user-select: none;
26-
26+
&:focus:after {
27+
content: '';
28+
position: absolute;
29+
left: 0;
30+
top: 0;
31+
width: 100%;
32+
height: 100%;
33+
${focusOutline}
34+
outline-offset: -6px;
35+
}
2736
${props =>
2837
props.selected &&
2938
`
@@ -35,7 +44,7 @@ const StyledTab = styled.button`
3544
margin-left: -8px;
3645
margin-right: -8px;
3746
`}
38-
&:after {
47+
&:before {
3948
content: '';
4049
position: absolute;
4150
width: calc(100% - 4px);

0 commit comments

Comments
 (0)