Skip to content

Commit

Permalink
Improving text and example (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabetdev authored Mar 23, 2020
1 parent 894afd2 commit fc99765
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src-docs/src/views/code/code_block_pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export default () => (
paddingSize="m"
color="dark"
overflowHeight={300}
whiteSpace="pre"
isCopyable>
<div>
When the whiteSpace property is set to pre all the whitespaces will be kept as is and the text only wraps when line breaks are in the content.
In this example, the whiteSpace property is set to pre. All the whitespaces will be kept as is and the text only wraps when line breaks are in the content.
</div>
</EuiCodeBlock>
Expand Down
9 changes: 6 additions & 3 deletions src-docs/src/views/code/code_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const CodeExample = {
demo: <CodeBlock />,
},
{
title: 'CodeBlock with pre white space',
title: 'CodeBlock and white-space',
source: [
{
type: GuideSectionTypes.JS,
Expand All @@ -85,8 +85,11 @@ export const CodeExample = {
],
text: (
<p>
<EuiCode>EuiCodeBlock</EuiCode> allows whiteSpace property to be set
allowing user to breaks/white space forcefuly or not.
By default, the <EuiCode>whiteSpace</EuiCode> property is set to{' '}
<EuiCode>pre-wrap</EuiCode>. This makes the text wrap when needed. You
can, however, pass <EuiCode>pre</EuiCode> to the{' '}
<EuiCode>whiteSpace</EuiCode> prop and the text won&apos;t wrap unless
line breaks are in the content.
</p>
),
props: { EuiCodeBlockImpl },
Expand Down

0 comments on commit fc99765

Please sign in to comment.