Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Official Guide to Mermaid.js

You're reading from   The Official Guide to Mermaid.js Create complex diagrams and beautiful flowcharts easily using text and code

Arrow left icon
Product type Paperback
Published in Sep 2021
Publisher Packt
ISBN-13 9781801078023
Length 492 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Knut Sveidqvist Knut Sveidqvist
Author Profile Icon Knut Sveidqvist
Knut Sveidqvist
Ashish Jain Ashish Jain
Author Profile Icon Ashish Jain
Ashish Jain
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Getting Started with Mermaid
2. Chapter 1: The Art of Documentation with Mermaid FREE CHAPTER 3. Chapter 2: How to Use Mermaid 4. Chapter 3: Mermaid Versions and Using the Live Editor 5. Chapter 4: Modifying Configurations with or without Directives 6. Chapter 5: Changing Themes and Making Mermaid Look Good 7. Section 2: The Most Popular Diagrams
8. Chapter 6: Using Flowcharts 9. Chapter 7: Creating Sequence Diagrams 10. Chapter 8: Rendering Class Diagrams 11. Chapter 9: Illustrating Data with Pie Charts and Understanding Requirement Diagrams 12. Section 3: Powerful Diagrams for the Advanced User
13. Chapter 10: Demonstrating Connections Using Entity Relationship Diagrams 14. Chapter 11: Representing System Behavior with State Diagrams 15. Chapter 12: Visualizing Your Project Schedule with Gantt Chart 16. Chapter 13: Presenting User Behavior with User Journey Diagrams 17. Other Books You May Enjoy Appendix :Configuration Options

Styling and Theming

This is the last section in this chapter, but but definitely not the least. In this section, you will learn how to add custom CSS styles to a specific class in the diagram. We will also focus on the class diagram-specific theme variables that can be overridden to give a different look to our overall diagram. Again, these are advanced features, and the best way of experimenting with these functionalities is to use Mermaid integrated on an HTML page. You could use a similar setup to the one you followed for the interaction. That way, you will have control over the <style> tag and the Mermaid theme variable configurations.

Let's start by looking at the custom styles that only impact the classes for which those custom styles are attached.

Styling a specific class of a class diagram

In Mermaid, it is possible to supply your own custom CSS styles and apply them to only specific elements of the class diagram. By this, we mean that it is possible to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image