Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip to canvas link style #21021

Merged
merged 3 commits into from
Feb 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 18 additions & 4 deletions code/ui/manager/src/components/sidebar/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,27 @@ const SkipToCanvasLink = styled(Button)(({ theme }) => ({
'@media (min-width: 600px)': {
display: 'block',
position: 'absolute',
width: '100%',
padding: '10px 15px',
fontSize: theme.typography.size.s1,
zIndex: 3,
transform: 'translate(0,-100px)',
border: 0,
width: 1,
height: 1,
padding: 0,
margin: -1,
overflow: 'hidden',
clip: 'rect(0, 0, 0, 0)',
whiteSpace: 'nowrap',
wordWrap: 'normal',
Comment on lines +49 to +57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style is Visually Hidden. It is an element while still allowing it to be exposed to assistive technologies (such as screen readers).

ref: https://getbootstrap.com/docs/5.0/helpers/visually-hidden/

opacity: 0,
transition: 'opacity 150ms ease-out',
'&:focus': {
transform: 'translate(0)',
width: '100%',
height: 'inherit',
padding: '10px 15px',
margin: 0,
clip: 'unset',
overflow: 'unset',
opacity: 1,
},
},
}));
Expand Down