Skip to content

Commit

Permalink
Adds CSS support
Browse files Browse the repository at this point in the history
  • Loading branch information
nickkadutskyi committed Jan 4, 2025
1 parent d43ea35 commit 0ef187c
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@

| Language | Treesitter | Semantic |
|----------|-----------------|----------|
| C/C++ | ✅ (c,cpp) | ⚠️ |
| JSON | ✅ (json) | ⚠️ |
| C/C++ | ✅ (c,cpp) | n/a |
| CSS | ✅ (css) | n/a |
| JSON | ✅ (json) | n/a |
| Lua | ✅ (lua,luadoc) ||
| PHP | ✅ (php,phpdoc) ||

Expand Down
41 changes: 41 additions & 0 deletions lua/jb/palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,36 @@
},
"Variables": null
},
"CSS": {
"AmpersandSelector": null,
"At-keyword": "LanguageDefaults|Keyword",
"AttributeName": null,
"BadCharacter": null,
"Braces": null,
"Brackets": null,
"ClassName": "CSS|Identifier",
"Colon": null,
"Comma": null,
"Comment": null,
"Dot": null,
"Function": "HTML|TagName",
"HexColor": null,
"IdSelector": "CSS|Identifier",
"Identifier": "HTML|TagName",
"Important": null,
"Number": null,
"OperationSign": null,
"Parenthesis": null,
"PropertyName": "HTML|AttributeName",
"PropertyValue": null,
"PseudoSelector": "CSS|Identifier",
"Semicolon": null,
"String": null,
"TagName": "HTML|TagName",
"UnicodeRange": null,
"Unit": null,
"URL": null
},
"GitToolBoxColors": {
"EditorInlineBlame": {
"light": {
Expand Down Expand Up @@ -2501,6 +2531,17 @@
"@type.definition.cpp": "Cpp|Typedef",
"@variable.member.cpp": "Cpp|StructField"
},
"Treesitter.CSS": {
"@attribute.css": "CSS|PseudoSelector",
"@character.special.css": "CSS|Identifier",
"@constant.css": "CSS|IdSelector",
"@function.css": "CSS|Function",
"@keyword.directive.css": "CSS|At-keyword",
"@property.css": "CSS|PropertyName",
"@tag.css": "CSS|TagName",
"@type.css": "CSS|ClassName",
"@variable.css": "CSS|Identifier"
},
"Treesitter.Doxygen": {
"@keyword.doxygen": "LanguageDefaults|Comments|DocComment|Tag",
"@variable.parameter.doxygen": "Cpp|Doxygen|CommandValue"
Expand Down
45 changes: 45 additions & 0 deletions samples/sample.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import "manual.css";

@font-face {
font-family: DroidSans;
src: url(DroidSans.ttf);
unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
}

:root {
--primary-color: #FFA500;
}

@media (max-width: 320px) and (orientation: portrait) {
:root {
--primary-color: hsl(22deg, 100%, 42%);
}
}

h2.special-title:lang(en) {
color: blue; /* comment */

&:hover {
color: var(--primary-color, red);
}
}

a[type$=".pdf"]:after {
content: '(' url(pdf.svg) attr(data-size) ')';
}

#main-logo {
border: 1px solid rgb(255, 0, 0);
}

div > p,
p ~ ul,
p + blockquote {
width: 80% !important;
}

* {
box-sizing: border-box;
}

!

0 comments on commit 0ef187c

Please sign in to comment.