improves markdown presentation

This commit is contained in:
jessop 2019-02-04 00:50:31 -05:00
parent c0e20f0420
commit 3a380598af
7 changed files with 50 additions and 27 deletions

View file

@ -5,19 +5,10 @@
} }
.asset-document { .asset-document {
$asset-info-width: 1000px;
max-width: $asset-info-width;
width: 100%; width: 100%;
padding: $thin-padding; padding: $thin-padding;
height: fit-content; height: fit-content;
box-sizing: border-box;
@media (max-width: $break-point-tablet) {
margin: $primary-padding $secondary-padding;
}
@media (max-width: $break-point-mobile) {
margin: $primary-padding 0;
}
} }
.asset-display { .asset-display {
height: fit-content; height: fit-content;

View file

@ -2,13 +2,17 @@
padding-top: $thin-padding; padding-top: $thin-padding;
padding-bottom: $thin-padding; padding-bottom: $thin-padding;
display: inline-block; display: inline-block;
font-size: 12px; font-weight: bold;
font-size: $text-medium;
width: 100%;
box-sizing: border-box;
} }
.label-radio { .label-radio {
padding-left: $thin-padding; padding-left: $thin-padding;
padding-right: $thin-padding; padding-right: $thin-padding;
cursor: pointer; cursor: pointer;
font-weight: bold;
} }
@media (max-width: $break-point-tablet ) { @media (max-width: $break-point-tablet ) {

View file

@ -8,14 +8,14 @@
h6 { h6 {
font-size: inherit; font-size: inherit;
font-weight: 600; font-weight: 600;
margin-bottom: var(--spacing-vertical-medium); margin-bottom: $tertiary-padding;
padding-top: var(--spacing-vertical-medium); padding-top: $tertiary-padding;
} }
// Paragraphs // Paragraphs
p { p {
font-size: 1.15rem; font-size: 1.15rem;
margin-bottom: var(--spacing-vertical-medium); margin-bottom: $tertiary-padding;
white-space: pre-line; white-space: pre-line;
svg { svg {
@ -28,15 +28,24 @@
} }
} }
blockquote {
border-radius: 8px;
background: $blockquote-background;
padding: $tertiary-padding;
min-width: 60%;
}
// Strikethrough text // Strikethrough text
del { del {
} }
// Tables // Tables
table { table {
width: 100%;
margin-bottom: 1.2rem; margin-bottom: 1.2rem;
padding: var(--spacing-vertical-medium);
background-color: $base-color; background-color: $base-color;
border-spacing: 0;
border: .5px solid $chrome-color;
tr { tr {
td, td,
@ -45,15 +54,32 @@
th:first-of-type, th:first-of-type,
td:last-of-type, td:last-of-type,
th:last-of-type { th:last-of-type {
padding: var(--spacing-vertical-medium); padding: $thin-padding $tertiary-padding;
text-overflow: ellipsis;
} }
td:last-of-type {
text-align: right;
}
th {
background: $chrome-color;
}
}
tr:nth-child(even){
background: $chrome-color;
} }
} }
// Image // Image
img { img {
margin-bottom: var(--spacing-vertical-medium); margin-bottom: $tertiary-padding;
padding-top: var(--spacing-vertical-medium); margin-top: $tertiary-padding;
padding: $secondary-padding;
object-fit: scale-down;
max-width: 100%;
border: $subtle-border;
box-sizing: border-box;
} }
// Horizontal Rule // Horizontal Rule
@ -77,8 +103,8 @@
} }
code { code {
margin-bottom: var(--spacing-vertical-medium); margin-bottom: $tertiary-padding;
padding: var(--spacing-vertical-medium); padding: $tertiary-padding;
background-color: $subtle-border-color; background-color: $subtle-border-color;
color: $text-color; color: $text-color;
@ -94,7 +120,7 @@
// Lists // Lists
ul, ul,
ol { ol {
margin-bottom: var(--spacing-vertical-medium); margin-bottom: $thin-padding;
> li { > li {
list-style-position: outside; list-style-position: outside;
@ -106,7 +132,7 @@
} }
li { li {
margin-left: var(--spacing-vertical-large); margin-left: $primary-padding;
p { p {
display: inline-block; display: inline-block;

View file

@ -4,21 +4,21 @@
.row-labeled { .row-labeled {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: flex-start; justify-content: flex-start;
padding-bottom: $tertiary-padding; padding-bottom: $tertiary-padding;
} }
.row-labeled-label { .row-labeled-label {
width: 30%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
flex: 1; flex: 1;
} }
.row-labeled-content { .row-labeled-content {
align-self: center; align-self: center;
width: 70%; width: 100%;
} }
@media (max-width: $break-point-tablet ) { @media (max-width: $break-point-tablet ) {

View file

@ -2,6 +2,7 @@
$base-color: white; //default white $base-color: white; //default white
$card-color: white; //default white $card-color: white; //default white
$chrome-color: lightgray; //default white (navbar) $chrome-color: lightgray; //default white (navbar)
$blockquote-background: #EEEEFF;
$background-color: $base-color; $background-color: $base-color;
//text colors //text colors
@ -11,6 +12,7 @@ $text-color: #333;
$success-color: green; $success-color: green;
$failure-color: red; $failure-color: red;
$grey: #9095A5; $grey: #9095A5;
$blockquote-text: $text-color;
//borders and highlights //borders and highlights

View file

@ -38,7 +38,7 @@ class FileViewer extends React.Component {
<div className={'markdown'}> <div className={'markdown'}>
{ {
this.state.fileLoaded && this.state.fileLoaded &&
<ReactMarkdown source={this.state.fileText}/> <ReactMarkdown className={'markdown-preview'} source={this.state.fileText} skipHtml />
} }
{ {
!this.state.fileLoaded && !this.state.fileLoaded &&

View file

@ -37,7 +37,7 @@ class AssetInfo extends React.Component {
{ description && ( { description && (
<RowLabeled <RowLabeled
label={<Label value={'Description'} />} label={<Label value={'Description'} />}
content={<div className='asset-info__description'><ReactMarkdown source={description} disallowedTypes={['image']}/></div>} content={<div className='asset-info__description'><ReactMarkdown className={'markdown-preview'} source={description} /></div>}
/> />
)} )}
{editable && ( {editable && (