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

[EuiMarkdownEditor] Improve markdown editor font #3525

Merged
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/components/markdown_editor/_index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'markdown_editor';
@import 'markdown_editor_drop_zone';
@import 'markdown_format';
@import 'markdown_editor_preview';
@import 'markdown_editor_text_area';
@import 'markdown_editor_toolbar';
19 changes: 1 addition & 18 deletions src/components/markdown_editor/_markdown_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,4 @@
&:focus-within {
@include euiSlightShadowHover;
}

.euiMarkdownEditor__textArea,
.euiMarkdownEditor__previewContainer {
padding: $euiSizeM;
}
}

.euiMarkdownEditor__previewContainer {
@include euiScrollBar;
background: $euiColorEmptyShade;
height: 150px;
overflow-y: auto;
border: $euiBorderThin;
}

.euiMarkdownEditor__textArea {
background: $euiColorEmptyShade;
}
}
7 changes: 7 additions & 0 deletions src/components/markdown_editor/_markdown_editor_preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.euiMarkdownEditor__preview {
@include euiScrollBar;
height: 150px;
overflow-y: auto;
border: $euiBorderThin;
padding: $euiSizeM;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
.euiMarkdownEditor__textArea {
@include euiFormControlText;
font-family: $euiCodeFontFamily;
width: 100%;
height: 100%;
min-height: 150px;
padding: $euiSizeM;
background-color: $euiFormBackgroundColor;
border: $euiBorderThin;
border-bottom: 1px dashed $euiColorLightShade;
border-color: $euiColorLightShade;
// Overrides the euiFormControlText line-height that is very small
line-height: $euiLineHeight;
resize: vertical;

&:focus {
Expand Down
9 changes: 2 additions & 7 deletions src/components/markdown_editor/_markdown_format.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ $euiDefaultFontSize: 14px;
}

.euiMarkdownFormat {
// sass-lint:disable-block indentation
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
@include euiFont;
@include euiText;

// Font size variables
$euiMarkdownFontSizeS: canvasToEm(12px);
Expand All @@ -46,10 +45,6 @@ $euiDefaultFontSize: 14px;
$euiMarkdownAlphaLightShadeReversed: rgba($euiColorEmptyShade, .15);
$euiMarkdownAlphaDarkShadeReversed: rgba($euiColorEmptyShade, .65);

&--reversed {
color: $euiColorLightestShade;
}

> *:first-child {
// sass-lint:disable-block no-important
margin-top: 0 !important;
Expand Down
2 changes: 1 addition & 1 deletion src/components/markdown_editor/markdown_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const EuiMarkdownEditor: FunctionComponent<EuiMarkdownEditorProps> = ({

{isPreviewing ? (
<div
className="euiMarkdownEditor__previewContainer"
className="euiMarkdownEditor__preview"
style={{ height: `${height}px` }}>
<EuiMarkdownFormat processor={processor}>{value}</EuiMarkdownFormat>
</div>
Expand Down