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

feat: add override function #70

Merged

Conversation

AlejandroSuero
Copy link
Contributor

I explained all better in #69 with more examples.

This feature will introduce the ability to override highlight groups using the theme's palette or hard coding it as it's done in theme.highlights.

This feature also let's the users and the developers see the available colours in the palette and their corresponding values.

Autocompletion

Note

This screenshot was taken from inside require("cyberdream").setup

Closes #69

@scottmckendry
Copy link
Owner

Amazing! Thank you @AlejandroSuero for raising such a detailed and well-thought-out PR.

I do have one question, just looking through the code: How does having a function for overrides here improve on pulling in the colors with a require? For example:

{
        "scottmckendry/cyberdream.nvim",
        lazy = false,
        priority = 1000,
        config = function()
            local colors = require("cyberdream.colors").default -- Import the default cyberdream colors
            require("cyberdream").setup({
                theme = {
                    highlights = {
                        Constant = { fg = colors.cyan },
                    },
                },
            })
            vim.cmd("colorscheme cyberdream")
        end,
    },

I've checked out your PR to confirm, and we can still benefit from your updates to types by doing it this way, which is excellent!

@scottmckendry
Copy link
Owner

Never mind, I've answered my own question. The function works flawlessly when toggling between dark and light modes which isn't currently possible with the example in my previous comment.

Great work!

@scottmckendry scottmckendry merged commit 344db87 into scottmckendry:main Jun 14, 2024
@AlejandroSuero AlejandroSuero deleted the feature/add-override-function branch June 14, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat]: more colour distinction
2 participants