Skip to content

💈 CSS tokenisation inconsistencies #131

@luxonauta

Description

@luxonauta

Hey 👋🏻 @huozhi, thanks for the work with this library! 💜

I'm updating the Dracula Theme website and trying it.

I identified some inconsistencies in the CSS highlighting that affect tokenisation accuracy. Specifically, CSS properties and hexadecimal values are not being categorised correctly according to the available TokenTypes.

For the following CSS snippet:

body {
  background: #000;
}

The tokenisation I would expect:

  • bodyidentifier;
  • {sign;
  • backgroundproperty;
  • :sign;
  • #000string or number;
  • ;sign;
  • }sign.

Current tokenisation:

  • bodyidentifier;
  • {sign;
  • backgroundidentifier → (should be property);
  • :sign;
  • #sign → (should be part of string or number);
  • 000number → (should be part of string or number);
  • ;sign;
  • }sign.

If this is expected and correct, would the next step be to change the colours based on the language? 🤔

This part is crucial to us, because on the new page dedicated to the Dracula Theme and Alucard specifications, we have sections like these to exemplify what is expected:

/* Pink - White */
body {
  /* Cyan - Pink - Purple */
  background: #000;
}

/* Green - White */
#dracula {
  display: none;
  visibility: hidden;
  height: calc(var(--deathDate) - var(--birthDate));
  /* Cyan - Pink - Yellow */
  font-family: "Transylvania";
  /* Cyan - Pink - Purple */
  opacity: 0;
}

This should also be accurate on the website to avoid generating unnecessary noise. 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions