microsoft / vscode-css

CSS Textmate grammar for syntax highlighting
Other
17 stars 15 forks source link

Add support for container, container-name, and container-type. #14

Closed FifthTundraG closed 1 year ago

starball5 commented 1 year ago

You might want to take a look at the other things that @wileycoyote78 did in their https://github.com/wileycoyote78/custom-css/blob/main/.vscode/custom-css.json

FifthTundraG commented 1 year ago

You might want to take a look at the other things that @wileycoyote78 did in their https://github.com/wileycoyote78/custom-css/blob/main/.vscode/custom-css.json

I'm aware that I did not add @container, the system for syntax highlighting at-rules built-in to vscode differs from the custom-css.json file @wileycoyote78 made in that it appears to be much more difficult. I attempted to add it, but it seems to require a bunch of regex which I am unfamiliar with. I might attempt to venture into this in the future, but for now at least we have something 🙂

wileycoyote78 commented 1 year ago

I was meaning to get into learning syntax hilighting, too. I don't care much for regex, though. 😅

wileycoyote78 commented 1 year ago

Figured it out! See my pull request .

In looking at the cson file, I realized there is no need to deal with regex. The @container is basically identical to @media. So, I just copied the @media block, pasted it, and changed the regex to look for 'container' in the new lines.

I tested by going directly into my css.tmLanguage.json file and doing the same thing (copied the @media block). And it works!

@starball5

FifthTundraG commented 1 year ago

Figured it out! See my pull request .

In looking at the cson file, I realized there is no need to deal with regex. The @container is basically identical to @media. So, I just copied the @media block, pasted it, and changed the regex to look for 'container' in the new lines.

I tested by going directly into my css.tmLanguage.json file and doing the same thing (copied the @media block). And it works!

@starball5

Yay!

wileycoyote78 commented 1 year ago

Also added your changes to my local file, and it works! Thanks!

P.S.: aspect-ratio also is not colorized, but now I know how to fix it... :)