Skip to content

(CSS) missing properties #3308

Closed
Closed
@waarissyb

Description

@waarissyb

I noticed some CSS properties not being highlighted properly. I found css-shared.js to be missing some properties. Mainly it concerns CSS Grid properties.

Example of produced highlighting:
hljs112-result

Expected behavior:
hljs112-expected

As CSS is nowadays defined by numerous standards and drafts, it’s debatable what should be added. Currently I’m preparing a pull request for this, and I want to discuss what to add.

My solution
To keep the PR simple, I will only add missing CSS properties to css-shared.js. I’m using https://www.w3.org/Style/CSS/all-properties.en.html as my source, which is more useful than the reference of MDN. The latter isn’t complete and contains more than only properties.

Only properties that are part of a W3C Recommendation or Candidate Recommendation will be added. This choice can be seen as conservative, as some properties already listed (like overflow-x) are part of a specification that’s still an Editor’s Draft.

Because the aural part of CSS 2.1 has been deprecated, I will skip those properties and use the properties from CSS Speech Module instead. Other specifications that I’ll consult are:

  • CSS Basic User Interface Module Level 3 (CSS3 UI)
  • CSS Cascading and Inheritance Level 3
  • CSS Fonts Module Level 3
  • CSS Grid Layout Module Level 1
  • CSS Masking Module Level 1
  • CSS Scroll Snap Module Level 1
  • CSS Shapes Module Level 1
  • CSS Template Layout Module
  • CSS Text Module Level 3
  • CSS Transforms Module Level 1
  • CSS Will Change Module Level 1
  • CSS Writing Modes Level 3
  • CSS Writing Modes Level 4
  • Compositing and Blending Level 1

I will be adding around a hundred properties. Any thoughts on the above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions