Răsfoiți Sursa

smaller font for comment markdown

sou 7 ani în urmă
părinte
comite
a79e101fc6

+ 6 - 1
resource/js/components/Page/RevisionBody.js

@@ -51,7 +51,7 @@ export default class RevisionBody extends React.Component {
             this.props.inputRef(elm);
           }
         }}
-        className="wiki" dangerouslySetInnerHTML={this.generateInnerHtml(this.props.html)}>
+        className={this.props.type} dangerouslySetInnerHTML={this.generateInnerHtml(this.props.html)}>
       </div>
     );
   }
@@ -63,4 +63,9 @@ RevisionBody.propTypes = {
   isMathJaxEnabled: PropTypes.bool,
   renderMathJaxOnInit: PropTypes.bool,
   renderMathJaxInRealtime: PropTypes.bool,
+  type: PropTypes.string,
+};
+
+RevisionBody.defaultProps = {
+  type: 'wiki',
 };

+ 1 - 0
resource/js/components/PageComment/CommentPreview.js

@@ -22,6 +22,7 @@ export default class CommentPreview extends React.Component {
 
         <RevisionBody
           {...this.props}
+          type="comment"
         />
       </div>
     );

+ 19 - 8
resource/styles/scss/_wiki.scss

@@ -1,11 +1,4 @@
-div.body {
-  padding: 10px;
-}
-
-.wiki {
-  line-height: 1.8em;
-  font-size: 15px;
-
+%markdown-html {
   h1, h2, h3, h4, h5, h6 {
     margin-top: 1.6em;
     margin-bottom: .8em;
@@ -145,6 +138,24 @@ div.body {
   }
 }
 
+div.body {
+  padding: 10px;
+}
+
+.wiki {
+  line-height: 1.8em;
+  font-size: 15px;
+
+  @extend %markdown-html;
+}
+
+.comment {
+  line-height: 1.2em;
+  font-size: 10px;
+
+  @extend %markdown-html;
+}
+
 // mobile
 .page-mobile .wiki .revision-head {
   .revision-head-link,