Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Class not applied in classDiagram when escaped class name begins with a number #5106

Closed
jacbz opened this issue Dec 4, 2023 · 5 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@jacbz
Copy link

jacbz commented Dec 4, 2023

Description

When I attach a CSS class to a class where the name was escaped, and the name starts with a number, the CSS class is not applied.

Steps to reproduce

Generate diagram for this:

classDiagram
class `2c`:::className {
    << Test >>
}

Expected: 2c has CSS class "className".

Actual: 2c does not have CSS class "className".

Setup

  • Mermaid version: 10.6.0
  • Browser and Version: Chrome
@jacbz jacbz added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Dec 4, 2023
@sidharthv96
Copy link
Member

sidharthv96 commented Dec 6, 2023

General query: Can classes actually start with numbers?

cc @jgreywolf

@jgreywolf
Copy link
Contributor

I do not think there is anything specifically disallowing this to work.

However, looks like there is currently an issue with the ::: syntax - see #1649

I will check the number question - otherwise will close this as duplicate

@aviram-shubeili
Copy link

Description

When I attach a CSS class to a class where the name was escaped, and the name starts with a number, the CSS class is not applied.

Steps to reproduce

Generate diagram for this:

classDiagram
class `2c`:::className {
    << Test >>
}

Expected: 2c has CSS class "className".

Actual: 2c does not have CSS class "className".

Setup

  • Mermaid version: 10.6.0
  • Browser and Version: Chrome

@jacbz semi-related question - where are you defining the css Class?

@jacbz
Copy link
Author

jacbz commented Jan 23, 2024

This is a minimal sandbox example what does not need the actual CSS definition.

@jgreywolf
Copy link
Contributor

Closing in favor of #1649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

4 participants