Markdown
The fixed type scale is used with GitLab Flavored Markdown (GLFM) and for content such as tables, task lists, and code blocks. This includes styling for the following GLFM components.
Blockquote
Code
Code blocks
Wrap a block of <code> within a <pre> element. For example, multi-line code that has syntax highlighting. The size of the text will adjust based on the parent text size.
A code block fits the width of the parent container and its content scrolls horizontally if it overflows the block.
Inline code
Highlight inline text as <code>. For example, a short line of code, a CSS class, or a variable. The size of the text will adjust based on the parent text size.
Inline diffs
Syntax highlight code block
Collapsible content
Color chips
Diagrams (mermaid)
Emoji
Footnotes
Horizontal rule
Labels
Lists
Unordered list
Ordered list
Table
Task list
Definition list
Math (KaTeX)
Media
Images
Embedded video
Embedded audio
Table of contents
Super/subscript
User/group mentions
Code reference
The GlMarkdown component styles markdown-generated HTML following the Pajamas Documentation Markdown
styling specifications.
You can use the GlMarkdown component in two ways.
GlMarkdown
<script>
import { GlMarkdown } from '@gitlab/ui';
export default {
components: {
GlMarkdown,
}
}
</script>
<template>
<gl-markdown>
<!-- All the content inside gl-markdown will inherit the documentation markdown styles -->
</gl-markdown>
</template>gl-markdown class selector
Follow the GitLab UI CSS guidelines
to include GitLab UI CSS in your application. Afterwards, you can apply the gl-markdown class
selector to the root element that contains the markdown-generated HTML.
<body class="gl-markdown">
<!-- All the content inside body.gl-markdown will inherit the documentation markdown styles -->
</body>Compact markdown
Set the compact property to true in GlMarkdown to apply the compact markdown styles.
<gl-markdown compact></gl-compact>You can also append the gl-compact-markdown class selector after gl-markdown in markdown-generated
HTML.
<body class="gl-markdown gl-compact-markdown">
</body>Related
Last updated at: