Comments (13)
So after doing some digging, this is the best I can come up with:
Your settings should be:
filetype_hlgroups = {
scss = {
TSFunction = { fg = "${cyan}" },
TSProperty = { fg = "${orange}" },
TSPunctDelimiter = { fg = "${orange}" },
TSType = { fg = "${red}" },
},
}
Basically, Treesitter groups nearly everything in an scss
file as TSProperty
so we're really limited as to how much detail we can specify for the highlight groups.
from onedarkpro.nvim.
Running it through TSPlayground
I get:
Seems Treesitter ignores it. Normally you would expect something like:
from onedarkpro.nvim.
@Asterovim tnis is covered in the readme under filetype highlighting 👍🏼️
from onedarkpro.nvim.
No but you can follow what I did in my commmit and send a PR. ChatGPT is a great tutor for Treesitter queries btw
from onedarkpro.nvim.
Could you paste your scss
code and I can take a look.
from onedarkpro.nvim.
Could you paste your
scss
code and I can take a look.
Thanks you 👍
.entete-twitter {
display: flex;
}
.field--name-field-tweet-content {
margin-left: rem-calc(50);
}
.field--name-field-tweet-user {
a {
text-decoration: none;
&:before {
content: "@";
}
}
}
.bloc-partenaires {
background: $zurb-color-grey;
.field--name-dynamic-twig-fieldblock-content-bloc-des-partenaires {
@include xy-grid-container($width: $container-home);
text-align: center;
#zf-splide-partenaires-accueil-list {
align-items: center;
}
.field--type-image {
text-align: center;
}
}
}
from onedarkpro.nvim.
So after doing some digging, this is the best I can come up with:
Your settings should be:
filetype_hlgroups = { scss = { TSFunction = { fg = "${cyan}" }, TSProperty = { fg = "${orange}" }, TSPunctDelimiter = { fg = "${orange}" }, TSType = { fg = "${red}" }, }, }Basically, Treesitter groups nearly everything in an
scss
file asTSProperty
so we're really limited as to how much detail we can specify for the highlight groups.
Thanks you so much.
Last question please, there is a way to change the color of "$zurb_color_grey" variable ?
from onedarkpro.nvim.
Thanks you 💯
from onedarkpro.nvim.
Hi,
I have a code that I would like to use, which looks like this:
require("onedarkpro").setup({
highlights = {
["@variable"] = { fg = "#293184" },
}
})
I want to apply this code only to SCSS files. Can you give me an example of how to accomplish this please? Also, is it possible to include other file types like .less + .scss ?
Thank you.
from onedarkpro.nvim.
@Asterovim tnis is covered in the readme under filetype highlighting 👍🏼️
Thanks you.
I have try :
require("onedarkpro").setup({
colors = {
whiskey = "#d19a66";
},
highlights = {
["@property.scss"] = { fg = "${whiskey}" },
}
})
It's works.
But, i would like to select @class_name and it didn't work :(
If i use :TSHighlightCapturesUnderCursor my class name is "@Property" and my code like (background-color) is also "@Property".
any idea ? thanks you.
from onedarkpro.nvim.
I've just played around with some SCSS...the Treesitter parser doesn't define many highlights so this will need some custom queries
from onedarkpro.nvim.
@Asterovim I've just added additional scss
support in d7513a7. Had to write some custom Treesitter queries to get it looking okay. Let me know what you think.
Before
After
Visual Studio Code
from onedarkpro.nvim.
@Asterovim I've just added additional
scss
support in d7513a7. Had to write some custom Treesitter queries to get it looking okay. Let me know what you think.Before
After
Visual Studio Code
Thanks you so mutch. It's very very good.
One question please.
There is a way to improve : after/queries/scss/highlights.scm and lua/onedarkpro/highlights/filetypes/scss.lua via config ?
So i can help you to improve it. I have see another small problem like :
@font-face {
font-family: "important-semi-bold";
src: url("../../../fonts/Oswald/Oswald-SemiBold.ttf") format("truetype");
}
.testselector {
&-children {
color: red;
}
}
from onedarkpro.nvim.
Related Issues (20)
- [Bug]: Custom queries override sane defaults HOT 2
- [Bug]: Can't override colors HOT 8
- Highlight DiffChange HOT 1
- [Bug]: missing comma in minimal config for bug reports
- [Bug]: @lsp.type.comment.lua overrides @text.uri.comment HOT 10
- [Bug]: Onedarkpro's highlights get overriden by typescript-language-server. HOT 15
- [Bug]: fixme/todos from comment parser overriden by semantic tokens in lua HOT 10
- Built-in linking takes precedence over the values set in the setup function HOT 2
- [Bug]: Very low contrast/unreadable text with light variant of the colorscheme HOT 11
- [Bug]: Error when setting `Comment` highlights (for the first time)? HOT 6
- [Bug]: Rust `#![attributes]` are not highlighted HOT 3
- [Bug]: onedark_dark floating panels indistinguishable HOT 8
- [Bug]: No Markdown Highlighting HOT 5
- [Bug]: lualine background has disappeared HOT 3
- [Bug]: missing treesitter-based highlight for JS/TS properties after breaking nvim-treesitter update HOT 5
- [Bug]: TS/TSX treesitter errors + broken syntax highlighting with onedark and latest nvim-treesitter HOT 6
- [Bug]: No highlight for selected complition in nvim-cmp with onedark_dark. HOT 4
- [Bug]: Change highlight on yank doesn't work. HOT 6
- [Bug]: Not an editor command: require("onedarkpro").setup HOT 3
- [Bug]: Transparent background not applied HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onedarkpro.nvim.