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

Mobile: Make editor styles closer to desktop #10377

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/editor/CodeMirror/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const createTheme = (theme: EditorTheme): Extension[] => {
borderColor: theme.colorFaded,
backgroundColor: 'rgba(155, 155, 155, 0.1)',

...(theme.isDesktop ? monospaceStyle : {}),
...monospaceStyle,
},

// CodeMirror wraps the existing inline span in an additional element.
Expand All @@ -161,7 +161,7 @@ const createTheme = (theme: EditorTheme): Extension[] => {
borderColor: isDarkTheme ? 'rgba(200, 200, 200, 0.5)' : 'rgba(100, 100, 100, 0.5)',
borderRadius: '4px',

...(theme.isDesktop ? monospaceStyle : {}),
...monospaceStyle,
},

'& .cm-mathBlock, & .cm-inlineMath': {
Expand All @@ -182,7 +182,7 @@ const createTheme = (theme: EditorTheme): Extension[] => {

// Override the default URL style when the URL is within a link
'& .tok-url.tok-link, & .tok-link.tok-meta, & .tok-link.tok-string': {
opacity: theme.isDesktop ? 0.6 : 1,
opacity: 0.6,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change causes a contrast-related accessibility issue with the default theme:
screenshot: Contrast checker: #00337799 with opacity 0.6 has contrast 3.8:1

},

// Applying font size changes with CSS rather than the theme below works
Expand Down Expand Up @@ -244,7 +244,6 @@ const createTheme = (theme: EditorTheme): Extension[] => {
{
tag: tags.link,
color: theme.urlColor,
textDecoration: theme.isDesktop ? undefined : 'underline',
},
{
tag: [mathTag, inlineMathTag],
Expand Down
Loading