Skip to main content

A professional GitLab-styled dark mode theme for MkDocs

Project description

GitLab MkDocs Theme

A professional, GitLab-styled dark mode theme for MkDocs with a modern design inspired by GitLab's documentation site.

Features

  • Dark Mode Design: Professional dark color scheme with excellent contrast
  • Responsive Layout: Works seamlessly on desktop, tablet, and mobile devices
  • Collapsible Sidebar: Mobile-friendly navigation with hamburger menu
  • Table of Contents: Right sidebar showing page sections for easy navigation
  • Professional Styling:
    • Code blocks with syntax highlighting
    • Styled tables with hover effects
    • Admonitions (note, warning, danger, success)
    • Blockquotes and typography
    • Smooth transitions and animations
  • Splash Page: Hero section template for homepage
  • Search Ready: Compatible with MkDocs search plugin

Installation

Install the theme using pip:

pip install mkdocs-gitlab-theme

Usage

Update your mkdocs.yml to use the GitLab theme:

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

Configuration

Basic Configuration

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

With Navigation

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

nav:
  - Home: index.md
  - Getting Started:
    - Overview: getting-started/overview.md
    - Installation: getting-started/installation.md
  - Documentation:
    - Guide: docs/guide.md
    - API: docs/api.md

With Search

theme:
  name: gitlab

plugins:
  - search:
      lang: en

Color Palette

The theme uses a professional dark mode color scheme:

  • Primary Text: #c7d2fe (Light Indigo)
  • Accent: #818cf8 (Indigo)
  • Background: #0f172a (Dark Slate)
  • Secondary Background: #1e293b
  • Border: #475569

Customization

Custom CSS

Create a docs/stylesheets/custom.css file and add it to your mkdocs.yml:

extra_css:
  - stylesheets/custom.css

Custom JavaScript

Create a docs/javascripts/custom.js file and add it to your mkdocs.yml:

extra_javascript:
  - javascripts/custom.js

Override Templates

To override theme templates, create an overrides directory:

docs/
├── index.md
├── overrides/
│   └── main.html
└── stylesheets/
    └── custom.css

Then update your mkdocs.yml:

theme:
  name: gitlab
  custom_dir: overrides

Markdown Extensions

The theme works with common MkDocs markdown extensions:

markdown_extensions:
  - pymdownx.superfences
  - pymdownx.tabbed
  - pymdownx.emoji
  - admonition
  - codehilite
  - toc:
      permalink: true

Admonitions

Use admonitions for highlighted content:

!!! note
    This is a note admonition.

!!! warning
    This is a warning admonition.

!!! danger
    This is a danger admonition.

!!! success
    This is a success admonition.

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or suggestions, please visit: https://gitlab.com/gitlab-org/mkdocs-gitlab-theme/-/issues

Changelog

Version 1.0.0

  • Initial release
  • Dark mode design
  • Responsive layout
  • Mobile-friendly navigation
  • Professional styling
  • Search compatibility

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_gitlab_theme-1.0.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_gitlab_theme-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_gitlab_theme-1.0.0.tar.gz.

File metadata

  • Download URL: mkdocs_gitlab_theme-1.0.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for mkdocs_gitlab_theme-1.0.0.tar.gz
Algorithm Hash digest
SHA256 509f00e721bc1cf19a949ad2076e429f013ce35fb44260b8cae7d8cc0c9656ca
MD5 4139d56953d5e8381bfe8614bb2072f2
BLAKE2b-256 e2d6dfe42a9c562300bd93d28df99ae7abf72b286f135f11960ccdb458472695

See more details on using hashes here.

File details

Details for the file mkdocs_gitlab_theme-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_gitlab_theme-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddd8ebb99b9a198860d09575f197655cab27f535224fb7d8f0dddf9bcf19c60a
MD5 3cc24cb24e876d9470c56d1ab682e6fa
BLAKE2b-256 e7ff09f08389ef61bd93b2666bb496c0150f3a0960e531758d32b578b0cae69f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page