Skip to content

Commit

Permalink
Put screenreaderOnly style in theme
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed May 30, 2024
1 parent 74b9472 commit 75a9cb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/app/content/components/Page/PageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Color from 'color';
import styled, { css } from 'styled-components/macro';
import MainContent from '../../../components/MainContent';
import { MAIN_CONTENT_ID } from '../../../context/constants';
import theme from '../../../theme';
import theme, { screenreaderOnly } from '../../../theme';
import { highlightStyles } from '../../constants';
import {
highlightBlockPadding,
Expand All @@ -21,15 +21,6 @@ export const contentTextStyle = css`
// Search and key term highlights need to target .math as well,
// otherwise math elements won't have full height background color
const SELF_AND_CHILD_MATH_SELECTOR = '&, & .math';
const screenreaderOnly = `
height: 1px;
width: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
clip-path: inset(100%);
clip: rect(1px, 1px, 1px, 1px);
`;

export default styled(MainContent)`
${contentTextStyle}
Expand Down
10 changes: 10 additions & 0 deletions src/app/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import { FlattenSimpleInterpolation } from 'styled-components';
import { css } from 'styled-components/macro';
// based on https://sketchviewer.com/sketches/59766aabb57e8900114c89ce/latest/

export const screenreaderOnly = `
height: 1px;
width: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
clip-path: inset(100%);
clip: rect(1px, 1px, 1px, 1px);
`;

export interface ColorSet {
base: string;
foreground: string;
Expand Down

0 comments on commit 75a9cb3

Please sign in to comment.