Рубрики

colors

What colors merge to produce red

With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!


GitLab Flavored Markdown (GLFM)

The abbreviation changed from GFM to GLFM in GitLab 14.10.

When you enter text in the GitLab UI, GitLab assumes the text is in the Markdown language. The text is rendered with a set of styles. These styles are called GitLab Flavored Markdown.

For example, in Markdown, an unordered list looks like this:

  • Cat
  • Dog
  • Turtle

These styles are valid for GitLab only. The GitLab documentation website and the main GitLab website use Kramdown instead.

You should not view this page in the documentation, but instead view these styles as they appear on GitLab.

GitLab Flavored Markdown extends the CommonMark specification. It was inspired by GitHub Flavored Markdown.

Where you can use GitLab Flavored Markdown

  • Comments
  • Issues
  • Merge requests
  • Milestones
  • Snippets (the snippet must be named with a .md extension)
  • Wiki pages
  • Markdown documents inside repositories
  • Epics

You can also use other rich text files in GitLab. You might have to install a dependency to do so. For more information, see the gitlab-markup gem project.

Differences between GitLab Flavored Markdown and standard Markdown

GitLab uses standard CommonMark formatting. However, GitLab Flavored Markdown extends standard Markdown with features made specifically for GitLab.

  • Color chips written in HEX , RGB or HSL
  • Diagrams and flowcharts
  • Emoji
  • Front matter
  • Inline diffs
  • Math equations and symbols written in LaTeX
  • Task Lists
  • Table of Contents
  • Wiki specific Markdown


Features not found in standard Markdown

The following features are not found in standard Markdown.

Colors

Markdown does not support changing text color.

  • HEX : `#RGB[A]` or `#RRGGBB[AA]`
  • RGB : `RGB[A](R, G, B[, A])`
  • HSL : `HSL[A](H, S, L[, A])`

Named colors are not supported.

In the GitLab application (but not the GitLab documentation) color codes in backticks display a color chip next to the color code. For example:

  • #F00
  • #F00A
  • #FF0000
  • #FF0000AA
  • RGB(0,255,0)
  • RGB(0%,100%,0%)
  • RGBA(0,255,0,0.3)
  • HSL(540,70%,50%)
  • HSLA(540,70%,50%,0.3)

Diagrams and flowcharts

  • Mermaid
  • PlantUML
  • Kroki to create a wide variety of diagrams.

In wikis, you can also add and edit diagrams created with the diagrams.net editor.

Mermaid

Visit the official page for more details. The Mermaid Live Editor helps you learn Mermaid and debug issues in your Mermaid code. Use it to identify and resolve issues in your diagrams.

To generate a diagram or flowchart, write your text inside the mermaid block:

B; A-->C; B-->D; C-->D; B; A-->C; B-->D; C-->D;

You can also include subgraphs:

 SubGraph1Flow subgraph "SubGraph 1 Flow" SubGraph1Flow(SubNode 1) SubGraph1Flow -- Choice1 --> DoChoice1 SubGraph1Flow -- Choice2 --> DoChoice2 end subgraph "Main Graph" Node1[Node 1] --> Node2[Node 2] Node2 --> SubGraph1[Jump to SubGraph1] SubGraph1 --> FinalThing[Final Thing] end SubGraph1Flow subgraph "SubGraph 1 Flow" SubGraph1Flow(SubNode 1) SubGraph1Flow -- Choice1 --> DoChoice1 SubGraph1Flow -- Choice2 --> DoChoice2 end subgraph "Main Graph" Node1[Node 1] --> Node2[Node 2] Node2 --> SubGraph1[Jump to SubGraph1] SubGraph1 --> FinalThing[Final Thing] end

PlantUML

PlantUML integration is enabled on GitLab.com. To make PlantUML available in self-managed installation of GitLab, a GitLab administrator must enable it.

Kroki

To make Kroki available in GitLab, a GitLab administrator must enable it. For more information, see the Kroki integration page.

Emoji

Rendered Markdown

Sometimes you want to around a bit and add some to your . Well we have a gift for you:

You can use emoji anywhere GitLab Flavored Markdown is supported.

You can use it to point out a or warn about patches. If someone improves your really code, send them some . People you for that.

If you’re new to this, don’t be . You can join the emoji . Just look up one of the supported codes.

Consult the Emoji Cheat Sheet for a list of all supported emoji codes.

Code

Sometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you: :zap: You can use emoji anywhere GitLab Flavored Markdown is supported. :v: You can use it to point out a :bug: or warn about :speak_no_evil: patches. And if someone improves your really :snail: code, send them some :birthday:. People :heart: you for that. If you're new to this, don't be :fearful:. You can join the emoji :family:. Just look up one of the supported codes. Consult the  

Emoji and your operating system

The previous emoji example uses hard-coded images. Rendered emoji in GitLab may be different depending on the OS and browser used.

Most emoji are natively supported on macOS, Windows, iOS, Android, and fall back on image-based emoji where there is no support.

On Linux, you can download Noto Color Emoji to get full native emoji support. Ubuntu 18.04 (like many modern Linux distributions) has this font installed by default.

To learn more about adding custom emoji, see Custom emoji.

Front matter

Front matter is metadata included at the beginning of a Markdown document, preceding the content. This data can be used by static site generators like Jekyll, Hugo, and many other applications.

When you view a Markdown file rendered by GitLab, front matter is displayed as-is, in a box at the top of the document. The HTML content displays after the front matter. To view an example, you can toggle between the source and rendered version of a GitLab documentation file.

In GitLab, front matter is used only in Markdown files and wiki pages, not the other places where Markdown formatting is supported. It must be at the very top of the document and must be between delimiters.


Using CSS

CSS can be added to HTML documents in 3 ways:

  • Inline - by using the style attribute inside HTML elements
  • Internal - by using a element in the section
  • External - by using a element to link to an external CSS file

The most common way to add CSS, is to keep the styles in external CSS files. However, in this tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for you to try it yourself.

Example


An external style sheet is used to define the style for many HTML pages.

To use an external style sheet, add a link to it in the section of each HTML page:

Example

This is a heading

This is a paragraph.

The external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension.

Here is what the "styles.css" file looks like:

"styles.css":

body <
background-color: powderblue;
>
h1 <
color: blue;
>
p <
color: red;
>

Tip: With an external style sheet, you can change the look of an entire web site, by changing one file!

Colin Wynn
the authorColin Wynn

Leave a Reply