Skip to content

Commit 82d71a6

Browse files
feat: responsive style for text description
1 parent 90b16cc commit 82d71a6

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

src/components/CodeArea/style.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
*/
1616

1717
.root {
18-
background-color: #272822;
1918
font-size: 16px;
2019
}
2120

2221
@media only screen and (max-width: 600px) {
23-
.root{
22+
.root {
2423
font-size: 8px;
2524
}
2625
}

src/components/TextDescription/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ import React from 'react';
1919
import GitHubMarkdownWrapper from 'hoc/GitHubMarkdownWrapper';
2020
import ReactMarkdownWithRenderers from 'components/ReactMarkdownWithRenderers';
2121
import { reactLoadingPatterns } from 'utils/data/concepts';
22+
import styles from './style.module.css';
2223

2324
const TextDescription = ({ selectedPatternId }) => {
2425
const pattern = reactLoadingPatterns.find(reactLoadingPattern => reactLoadingPattern.id === selectedPatternId);
2526

2627
return (
27-
<GitHubMarkdownWrapper>
28+
<GitHubMarkdownWrapper className={styles['code-font']}>
2829
<ReactMarkdownWithRenderers source={pattern.textDescription} />
2930
</GitHubMarkdownWrapper>
3031
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.code-font pre {
3+
font-size: 16px;
4+
}
5+
6+
@media only screen and (max-width: 600px) {
7+
.code-font pre {
8+
font-size: 8px;
9+
}
10+
}

src/hoc/GitHubMarkdownWrapper/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616

1717
import React from 'react';
1818
import 'github-markdown-css';
19+
import clsx from 'clsx';
1920

2021
import './style.css';
2122

22-
const GitHubMarkdownWrapper = ({ children }) => {
23+
const GitHubMarkdownWrapper = ({ children, className }) => {
2324
return (
24-
<div className='markdown-body'>
25+
<div className={clsx('markdown-body', className)}>
2526
{children}
2627
</div>
2728
);

0 commit comments

Comments
 (0)