From 101f3587047298567b95f474ca7d9da8d921a383 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Bevacqua?=
Date: Tue, 10 Apr 2018 22:41:22 -0300
Subject: [PATCH 1/2] support for pre, pre code, code
---
src/components/text/_text.scss | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/components/text/_text.scss b/src/components/text/_text.scss
index 3df7716145a..2142be42dc0 100644
--- a/src/components/text/_text.scss
+++ b/src/components/text/_text.scss
@@ -154,6 +154,30 @@
text-transform: uppercase;
}
+ pre {
+ height: 100%;
+ overflow: auto;
+ white-space: pre-wrap;
+ padding: $euiSize;
+ }
+
+ pre,
+ pre code {
+ display: block;
+ }
+
+ pre,
+ code {
+ background: $euiCodeBlockBackgroundColor;
+ color: $euiCodeBlockColor;
+ }
+
+ code {
+ line-height: $euiLineHeight;
+ font-family: $euiCodeFontFamily;
+ font-weight: $euiFontWeightRegular;
+ }
+
@include euiScaleText($euiFontSize);
&.euiText--small {
From e1357673b10ced1d50b8076fa5cb2da852480311 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Bevacqua?=
Date: Wed, 11 Apr 2018 11:01:59 -0300
Subject: [PATCH 2/2] Add examples
---
CHANGELOG.md | 5 +++--
src-docs/src/views/text/text.js | 12 ++++++++++++
src/components/text/_text.scss | 3 ++-
src/components/text/text.js | 2 +-
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3058fd992ba..c4626b493cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,12 @@
# [`master`](https://github.com/elastic/eui/tree/master)
-- Add disabled prop to `EuiComboBoxOption` ([#650](https://github.com/elastic/eui/pull/650))
+- Added `disabled` prop to `EuiComboBoxOption` ([#650](https://github.com/elastic/eui/pull/650))
+- Added support for `` and `` tags to `` ([#654](https://github.com/elastic/eui/pull/654))
# [`0.0.40`](https://github.com/elastic/eui/tree/v0.0.40)
- Tweaked sizing, weights, color, line-heights, and added more levels to `EuiTitle` and `EuiText` ([#627](https://github.com/elastic/eui/pull/627))
-- Add TypeScript type defitions for `EuiPortal`, `EuiText` and `EuiTitle` as well as the `calculatePopoverPosition` service ([#638](https://github.com/elastic/eui/pull/638))
+- Added TypeScript type defitions for `EuiPortal`, `EuiText` and `EuiTitle` as well as the `calculatePopoverPosition` service ([#638](https://github.com/elastic/eui/pull/638))
- Grayed out labels for `disabled` controls ([#648](https://github.com/elastic/eui/pull/648))
**Bug fixes**
diff --git a/src-docs/src/views/text/text.js b/src-docs/src/views/text/text.js
index f39fb8fe2f0..2eefdfe65f8 100644
--- a/src-docs/src/views/text/text.js
+++ b/src-docs/src/views/text/text.js
@@ -12,6 +12,18 @@ export default () => (
Far out in the uncharted backwaters of the unfashionable end of
the western spiral arm of the Galaxy lies a small unregarded
yellow sun.
+
+ When suddenly some wild JavaScript code appeared! const whoa = "!"
+
+
+
+
+ const completelyUnexpected = "the audacity!";
+
+
+
+
+ That was close.
diff --git a/src/components/text/_text.scss b/src/components/text/_text.scss
index 2142be42dc0..d67364f3725 100644
--- a/src/components/text/_text.scss
+++ b/src/components/text/_text.scss
@@ -7,7 +7,8 @@
ul,
ol,
blockquote,
- img {
+ img,
+ pre {
margin-bottom: convertToRem($baseLineHeightMultiplier * 3);
}
diff --git a/src/components/text/text.js b/src/components/text/text.js
index 7505ea7bbdf..082b1684c4f 100644
--- a/src/components/text/text.js
+++ b/src/components/text/text.js
@@ -19,7 +19,7 @@ export const EuiText = ({ size, color, children, className, ...rest }) => {
const classes = classNames(
'euiText',
textSizeToClassNameMap[size],
- className
+ className,
);
let optionallyColoredText;