diff --git a/README.md b/README.md index 4193154..cb0eaa0 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,8 @@ from the [CSS TextMate bundle](https://github.com/textmate/css.tmbundle). Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc. + +[CONTRIBUTOR NOTES] +A while back, I created a [custom-css](https://github.com/wileycoyote78/custom-css) json file to add support for the new *container* properties (@container, container, container-type, container-name) in order to remove the squiggly line. However, the color syntax was not applying to the properties. +Saw that someone had created a pull request to add color syntax to the properties, but not the at-rule (see PR#14). After studying the cson file, I realized that the existing @media rule is basically identical to the new @container rule. Just copied and pasted the @media rule lines, and changed the regex lines to look for 'container' instead of 'media'. +This, however, still does not correct the problem that any properties (i.e. padding, margin, etc.) inside an @container block do not display a description thumbnail thingy when hovering over them. diff --git a/grammars/css.cson b/grammars/css.cson index 0a243e3..d492914 100644 --- a/grammars/css.cson +++ b/grammars/css.cson @@ -221,6 +221,44 @@ } ] } + { + # @container + 'begin': '(?i)(?=@container(\\s|\\(|/\\*|$))' + 'end': '(?<=})(?!\\G)' + 'patterns': [ + { + 'begin': '(?i)\\G(@)container' + 'beginCaptures': + '0': + 'name': 'keyword.control.at-rule.media.css' + '1': + 'name': 'punctuation.definition.keyword.css' + 'end': '(?=\\s*[{;])' + 'name': 'meta.at-rule.media.header.css' + 'patterns': [ + { + 'include': '#media-query-list' + } + ] + } + { + 'begin': '{' + 'beginCaptures': + '0': + 'name': 'punctuation.section.media.begin.bracket.curly.css' + 'end': '}' + 'endCaptures': + '0': + 'name': 'punctuation.section.media.end.bracket.curly.css' + 'name': 'meta.at-rule.media.body.css' + 'patterns': [ + { + 'include': '$self' + } + ] + } + ] + } { # @counter-style 'begin': '(?i)(?=@counter-style([\\s\'"{;]|/\\*|$))' @@ -1498,7 +1536,7 @@ (?: # Standard CSS accent-color|additive-symbols|align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration - | animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backdrop-filter + | animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|aspect-ratio|backdrop-filter | backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image | background-origin|background-position|background-position-[xy]|background-repeat|background-size|bleed|block-size|border | border-block-end|border-block-end-color|border-block-end-style|border-block-end-width|border-block-start|border-block-start-color