Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCSS variable matching #13

Open
h0adp0re opened this issue Sep 5, 2022 · 15 comments
Open

SCSS variable matching #13

h0adp0re opened this issue Sep 5, 2022 · 15 comments
Labels
enhancement New feature or request

Comments

@h0adp0re
Copy link

h0adp0re commented Sep 5, 2022

Hello, would it be possible to implement something like this?
norcalli#22

@Akianonymus
Copy link

Yes, given i have to mostly copy the pr, but no eta.

@h0adp0re
Copy link
Author

h0adp0re commented Sep 5, 2022

Alright, that would be cool to have. I am not in a hurry to have it, just good to know it can (and will) be done!

@Akianonymus
Copy link

Test and report

#18

@Akianonymus Akianonymus added the enhancement New feature or request label Sep 9, 2022
@h0adp0re
Copy link
Author

h0adp0re commented Sep 9, 2022

Thanks, that was fast! Currently it seems the colors are only highlighted when they're defined in the same file. Sadly this is only a little useful when using imports – as one often does with sass. But maybe that could be done later in an incremental PR?

@Akianonymus
Copy link

Yes, i plan to add import support, just thinking how to actually implement it, because it's a big task, scanning other files, it can choke the editor.

Have to find an efficient way to scan imports.

@Akianonymus
Copy link

Done, imports should be working now along with recursive variables

@h0adp0re
Copy link
Author

Yes, now they do work, thank you!

I'd hate to be a bother but when the colors come from a second-level import they are not highlighted. Only first-level imports work currently. If that explanation makes any sense?

@Akianonymus
Copy link

Yes, now they do work, thank you!

I'd hate to be a bother but when the colors come from a second-level import they are not highlighted. Only first-level imports work currently. If that explanation makes any sense?

Check now

@h0adp0re
Copy link
Author

h0adp0re commented Sep 13, 2022

You've outdone yourself, thank you! I sadly am not qualified to review the PR but by my standards this issue is resolved.

@Akianonymus
Copy link

Akianonymus commented Sep 13, 2022

You've outdone yourself, thank you! I sadly am not qualified to review the PR but by my standards this issue is resolved.

Even i am not qualified to review, it got quite complicated. But thank you for testing. Will merge it soon.

@Akianonymus
Copy link

I have merged it to master.

@Johnsoct
Copy link

Johnsoct commented Jan 5, 2025

@h0adp0re @Akianonymus I know I'm two years late, but I'm struggling getting this highlighting working (scss variables and color functions). Can you guys spot anything weird with my config:

    {
        "catgoose/nvim-colorizer.lua",
        event = "BufReadPre",
        opts = {},
        config = function()
            local colorizer = require("colorizer")

            colorizer.setup({
                filetypes = { "css", "scss" },
                user_default_options = {
                    css = true,
                    mode = "background",
                    names = true,
                    RGBA = true,
                    RRGGBBAA = true,
                    sass = {
                        enable = true,
                        parsers = {
                            "css",
                        },
                    },
                },
            })
        end,
    },

@catgoose
Copy link
Owner

catgoose commented Jan 5, 2025

I'm not sure if the sass highlighting is working right now. I've tried to use git bisect to find where it was actually highlighting but I could never find a working commit. If you can find a commit where this is working (maybe it's a problem with how I was testing) I can try to get this working.

@catgoose catgoose reopened this Jan 5, 2025
@Johnsoct
Copy link

@catgoose Right now, I just set enabled to false and I'm still getting all the highlighting I would get in a CSS file, so that's doable for now. I'm sorry, but I just don't have the bandwidth to contribute. I'll bookmark the issue to come back to it if I get any time.

@catgoose
Copy link
Owner

@catgoose Right now, I just set enabled to false and I'm still getting all the highlighting I would get in a CSS file, so that's doable for now. I'm sorry, but I just don't have the bandwidth to contribute. I'll bookmark the issue to come back to it if I get any time.

Thanks. I plan to get to this issue, but I'm trying to finish up a few other things first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants