Sublime Forum

New CSS properties highlighting and auto-complete

#1

I was wondering when new CSS properties, particularly CSS grid properties, will be added to auto-complete and syntax highlighting? Is there any way I can add it for my own editor if no one is working on this? All of these need to be added:

grid-template-columns
grid-template-rows
grid-template-areas
grid-column-gap
grid-row-gap
grid-gap
grid-auto-columns
grid-auto-rows
grid-auto-flow
grid
grid-column-start
grid-column-end
grid-row-start
grid-row-end
grid-column
grid-row
grid-area

0 Likes

#2

you can edit https://github.com/sublimehq/Packages/blob/e8b489e42a9fb4ffd714d5ec82d7859a1b09c3f6/CSS/css_completions.py and https://github.com/sublimehq/Packages/blob/e8b489e42a9fb4ffd714d5ec82d7859a1b09c3f6/CSS/CSS.sublime-syntax#L468 and submit a PR, if they are part of the CSS spec

1 Like

#3

Thank you very much for the helpful reply. I have cloned them and made the additions to css_completions.py but i’m not that sure what i’m meant to add to CSS.sublime-syntax.

0 Likes

#4

I guess add all your grid properties to the end of the regex match under rule-list-body:, as the property-value-constants: already contains dense and auto and there are no other new possible values introduced.

Also, you will want to add some tests for your new properties in https://github.com/sublimehq/Packages/blob/bb9bdefa7026e6f4d146f8e10f1bc2d8b3752b7e/CSS/syntax_test_css.css

0 Likes

#5

@ollie-w did you ever get this to work? I am starting to use css grid now that it’s covered by the major browsers, and this would be a huge help.

0 Likes