catgoose / nvim-colorizer.lua

The fastest Neovim colorizer
Other
742 stars 46 forks source link

Bug: not color if variable #36

Open DartMitai opened 2 years ago

DartMitai commented 2 years ago

does not output a color if it is assigned to a variable, and outputs the color of lines that are not quite colors example text_black

Operating System: Fedora 37 x64

Neovim Version: 0.8.0 Colorizer Version: latest Снимок экрана от 2022-11-15 15-04-07 Снимок экрана от 2022-11-15 15-09-04 my settings

require("colorizer").attach_to_buffer(0, { mode = "background", css = true })
local colorizer = require('colorizer')
colorizer.setup {
  filetypes = { "dart" },
  user_default_options = {
    RGB = true, -- #RGB hex codes
    RRGGBB = true, -- #RRGGBB hex codes = true, -- "Name" codes like Blue or blue
    RRGGBBAA = true, -- #RRGGBBAA hex codes
    AARRGGBB = true, -- 0xAARRGGBB hex codes
    rgb_fn = true, -- CSS rgb() and rgba() functions
    hsl_fn = true, -- CSS hsl() and hsla() functions== --, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
    css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
    -- Available modes for `mode`: foreground, background, virtualtext
    mode = "virtualtext", --Set the display mode.
                      -- Available methods are false / true / "normal" / "lsp" / "both"
                      -- True is same as normal
    tailwind = false, -- Enable tailwind colors
        -- parsers can contain values used in |user_default_options|
    sass = { enable = false, parsers = { css }, }, -- Enable sass colors
    virtualtext = "■",
  }, 
  -- all the sub-options of filetypes apply to buftypes
  buftypes = {
    "*",
    "!prompt",
    "!popup"
  },
}
Akianonymus commented 1 year ago

This is just out of scope for this plugin. Values referencing is not supported, one way this can be done is by using lsp if it supports documentColor like tailwind.

rodhash commented 2 weeks ago

CSS variables also doesn't work?

:root {
  /* Here it is working */
  --primary-300: #f0abfc;
  --primary-400: #e879f9;
  --primary-500: #d946ef;
}

  /* Here it is not */
.title-underline {
  background: var(--primary-500);
}
catgoose commented 1 week ago

CSS variables also doesn't work?

:root {
  /* Here it is working */
  --primary-300: #f0abfc;
  --primary-400: #e879f9;
  --primary-500: #d946ef;
}

  /* Here it is not */
.title-underline {
  background: var(--primary-500);
}

image

Correct.