highlightjs / highlightjs/highlight.js

CSS-like grammars: remaining consistency work

Open
#4,489 1 comment 0 reactions 0 assignees View on GitHub
enhancement help welcome language
Dominant language
JavaScript
Stars
25k
Forks
3.8k
Avg merge
11h 35m
Merged PRs (30d)
3

Description

## Summary

Follow-up to #2269 (CSS, Sass/SCSS, Less, Stylus highlighting consistency).

Much of the original checklist was completed via:

- #2425 — Improve CSS consistency across CSS-like grammars
- #2937 — continue CSS Consistency

This issue tracks **what is still open**. Prefer fixes that keep behavior aligned across all CSS-like grammars that accept plain CSS (not one-off patches to a single language), and add markup tests where possible.

Grammars involved: `css`, `scss`, `less`, `stylus` (and any related CSS-like modes).

## Remaining checklist (from #2269)

### Cross-grammar sync

- [ ] Function highlighting (e.g. `grayscale(0.5)`, and nested/function-like forms such as `url()` / `format()` where appropriate)
- [ ] At-rules (`@import`, etc.)
- [ ] Variables
- [ ] Attributes / properties (remaining gaps vs shared baseline)
- [ ] Anything else still divergent — _what are we missing?_

### Per-language leftovers (from original bug lists)

**Sass**

- [ ] Function highlighting (`grayscale(0.5)`)
- [ ] At-rules highlighting differences (`@keyframes` `from` / `to`)

**Less**

- [ ] Function highlighting (`grayscale(0.5)`)
- [ ] Less was noted as still messy after #2937 — general cleanup / parity

**Stylus**

- [ ] Function highlighting (`grayscale(0.5)`)
- [ ] At-rules highlighting (`@font-face`, `@keyframes`, `from`, `to`)

## Guidance (from prior discussion)

- Prefer consolidating shared matchers / modes rather than copy-paste fixes.
- Build or extend markup tests across CSS-like grammars so they stay in sync.
- Incremental PRs that fix one checklist item **across** the relevant grammars are welcome.

## Related

- Parent / original issue: #2269
- Prior work: #2425, #2937

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the css, scss, less, and stylus grammar definitions and the markup tests, then compare handling of functions, at-rules, variables, and properties. Done means an incremental cross-grammar consistency fix with markup coverage for the selected checklist item and no one-off divergence.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, scss
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.