Skip to content

Commit

Permalink
fix(tab): indicate focus on Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbien committed Mar 24, 2020
1 parent 0f34f44 commit 86bf15f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import propTypes from 'prop-types';

import styled from 'styled-components';
import { createBorderStyles, createBoxStyles } from '../common';
import { createBorderStyles, createBoxStyles, focusOutline } from '../common';
import { blockSizes, padding } from '../common/system';

const StyledTab = styled.button`
Expand All @@ -23,7 +23,16 @@ const StyledTab = styled.button`
cursor: default;
color: ${({ theme }) => theme.text};
user-select: none;
&:focus:after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
${focusOutline}
outline-offset: -6px;
}
${props =>
props.selected &&
`
Expand All @@ -35,7 +44,7 @@ const StyledTab = styled.button`
margin-left: -8px;
margin-right: -8px;
`}
&:after {
&:before {
content: '';
position: absolute;
width: calc(100% - 4px);
Expand Down

0 comments on commit 86bf15f

Please sign in to comment.