Skip to content

Commit

Permalink
fix(tailwind): color rendering (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
minusfive authored Dec 16, 2024
1 parent 684950d commit 02528e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/blink/cmp/completion/windows/render/tailwind.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
local tailwind = {}

local kinds = require('blink.cmp.types').CompletionItemKind

--- @param item blink.cmp.CompletionItem
--- @return string|nil
function tailwind.get_hex_color(item)
local doc = item.documentation
if item.kind ~= 'Color' or not doc then return end
if item.kind ~= kinds.Color or not doc then return end
local content = type(doc) == 'string' and doc or doc.value
if content and content:match('^#%x%x%x%x%x%x$') then return content end
end
Expand Down

0 comments on commit 02528e8

Please sign in to comment.