Skip to content

Commit

Permalink
fix: update focus styling
Browse files Browse the repository at this point in the history
  • Loading branch information
stasiukanya authored and RomanHotsiy committed Jul 13, 2020
1 parent 3d25005 commit 30a27c1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/common-elements/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export const StyledDropdown = styled(Dropdown)`
font-size: 0.929em;
line-height: 1.5em;
cursor: pointer;
transition: border 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
&:hover,
&:focus-within {
border: 1px solid ${props => props.theme.colors.primary.main};
color: ${props => props.theme.colors.primary.main};
box-shadow: 0px 2px 4px 0px rgba(34, 36, 38, 0.12);
box-shadow: 0px 0px 0px 1px ${props => props.theme.colors.primary.main};
}
.dropdown-selector {
display: inline-flex;
Expand All @@ -55,6 +56,7 @@ export const StyledDropdown = styled(Dropdown)`
vertical-align: middle;
color: #263238;
left: 0;
transition: color 0.25s ease, text-shadow 0.25s ease;
}
.dropdown-arrow {
position: absolute;
Expand All @@ -73,7 +75,7 @@ export const StyledDropdown = styled(Dropdown)`
.dropdown-selector-content {
position: absolute;
margin-top: 2px;
left: -1px;
left: -2px;
right: 0;
z-index: 10;
Expand All @@ -90,7 +92,6 @@ export const StyledDropdown = styled(Dropdown)`
.dropdown-option {
font-size: 0.9em;
color: #263238;
background-color: #fff;
cursor: pointer;
padding: 0.4em;
Expand All @@ -102,6 +103,10 @@ export const StyledDropdown = styled(Dropdown)`
background-color: rgba(38, 50, 56, 0.12);
}
}
input {
cursor: pointer;
height: 1px;
}
}
`;

Expand All @@ -122,6 +127,7 @@ export const SimpleDropdown = styled(StyledDropdown)`
box-shadow: none;
.dropdown-selector-value {
color: ${props => props.theme.colors.primary.main};
text-shadow: 0px 0px 0px ${props => props.theme.colors.primary.main};
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/common-elements/linkify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const linkifyMixin = className => css`
line-height: 1;
width: 20px;
display: inline-block;
outline: 0;
}
${className}:before {
content: '';
Expand Down
4 changes: 3 additions & 1 deletion src/common-elements/samples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export const SampleControls = styled.div`
opacity: 0.4;
transition: opacity 0.3s ease;
text-align: right;
&:focus-within {
opacity: 1;
}
> button {
background-color: transparent;
border: 0;
Expand Down
3 changes: 3 additions & 0 deletions src/common-elements/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const Tabs = styled(ReactTabs)`
&.react-tabs__tab--selected {
color: ${props => props.theme.colors.text.primary};
background: ${({ theme }) => theme.rightPanel.textColor};
&:focus {
outline: auto;
}
}
&:only-child {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Endpoint/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const EndpointInfo = styled.button<{ expanded?: boolean; inverted?: boole
color: ${props => (props.inverted ? props.theme.colors.text.primary : '#ffffff')}
}
&:focus {
box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.3), 0 2px 0 rgba(128, 128, 128, 0.15);
box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(128, 128, 128, 0.25);
}
`;

Expand Down
1 change: 1 addition & 0 deletions src/components/PayloadSamples/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const InvertedSimpleDropdown = styled(StyledDropdown)`
&:hover,
&:focus-within {
border: none;
box-shadow: none;
}
&:focus-within {
background-color: ${({ theme }) => transparentize(0.3, theme.rightPanel.backgroundColor)};
Expand Down

0 comments on commit 30a27c1

Please sign in to comment.