Git Product home page Git Product logo

Comments (13)

olimorris avatar olimorris commented on June 25, 2024 1

So after doing some digging, this is the best I can come up with:

Screen Shot 2022-03-08 at 09 08 54@2x

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.

olimorris avatar olimorris commented on June 25, 2024 1

Running it through TSPlayground I get:

Screen Shot 2022-03-08 at 13 12 49@2x

Seems Treesitter ignores it. Normally you would expect something like:

Screen Shot 2022-03-08 at 13 13 31@2x

from onedarkpro.nvim.

olimorris avatar olimorris commented on June 25, 2024 1

@Asterovim tnis is covered in the readme under filetype highlighting 👍🏼️

from onedarkpro.nvim.

olimorris avatar olimorris commented on June 25, 2024 1

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.

olimorris avatar olimorris commented on June 25, 2024

Could you paste your scss code and I can take a look.

from onedarkpro.nvim.

Asterovim avatar Asterovim commented on June 25, 2024

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.

Asterovim avatar Asterovim commented on June 25, 2024

So after doing some digging, this is the best I can come up with:

Screen Shot 2022-03-08 at 09 08 54@2x

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.

Thanks you so much.

Last question please, there is a way to change the color of "$zurb_color_grey" variable ?
image

from onedarkpro.nvim.

Asterovim avatar Asterovim commented on June 25, 2024

Thanks you 💯

from onedarkpro.nvim.

Asterovim avatar Asterovim commented on June 25, 2024

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 avatar Asterovim commented on June 25, 2024

@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.

olimorris avatar olimorris commented on June 25, 2024

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.

olimorris avatar olimorris commented on June 25, 2024

@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

Screen Shot 2023-03-25 at 12 02 09@2x

After

Screen Shot 2023-03-25 at 12 01 19@2x

Visual Studio Code

Screen Shot 2023-03-25 at 12 03 42@2x

from onedarkpro.nvim.

Asterovim avatar Asterovim commented on June 25, 2024

@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

Screen Shot 2023-03-25 at 12 02 09@2x

After

Screen Shot 2023-03-25 at 12 01 19@2x

Visual Studio Code

Screen Shot 2023-03-25 at 12 03 42@2x

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;
  }
}

VSCODE :
image
image
Neovim :
image
image

from onedarkpro.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.