From 5ea295f857952d80d2423be78618e5e3841fdec7 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Fri, 22 May 2020 20:27:45 -0700 Subject: styling fixes --- frontend/src/components/renderers/Code.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/renderers/Code.js') diff --git a/frontend/src/components/renderers/Code.js b/frontend/src/components/renderers/Code.js index 02c1cc6..0c601b3 100644 --- a/frontend/src/components/renderers/Code.js +++ b/frontend/src/components/renderers/Code.js @@ -1,6 +1,7 @@ import React from 'react'; import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; import { atomOneLight, ascetic, atomOneDark, dracula, ocean } from 'react-syntax-highlighter/dist/esm/styles/hljs'; +import styled from 'styled-components' export const THEMES = Object.freeze({ 'atom': atomOneLight, @@ -34,16 +35,31 @@ export const LANGS = Object.freeze({ 'yaml': 'yaml' }) +const StyledPre = styled.pre` + padding: 0 !important; + margin: 0; +` + +const CodeBlock = styled.div` + width: 100%; + font-size: 0.8em; + padding: calc(0.8em - 1px) !important; + border-radius: 3px; + border: 1px solid #565656; + outline: none; + margin: 1.7em 0; +` + const CodeRenderer = React.forwardRef((props, ref) => { const Pre = (props) => { return ( -
+            
         );
     }
 
     return (
-        
+ { PreTag={Pre}> {props.content} -
+ ); }); -- cgit v1.2.3