-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a14dfc
commit e66abe3
Showing
2 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
local M = {} | ||
|
||
---@class TailwindTools.ClassEntry | ||
---@field name string | ||
---@field value any | ||
|
||
local function nil_wrap(fn) | ||
return function(args) | ||
local result = fn(args) | ||
if result ~= vim.NIL then return result end | ||
end | ||
end | ||
|
||
---@type fun(utilities: string[]): string? | ||
---Expands utility classes to CSS using tailwindcss library from the current project. | ||
---It uses PostCSS from the current project for TailwindCSS v3. | ||
--- | ||
---TODO: Support for v4 | ||
M.expand_utilities = nil_wrap(vim.fn.TailwindExpandUtilities) | ||
|
||
---@type fun(): TailwindTools.ClassEntry[]? | ||
---Gets available utility classes for the current project. | ||
---It is done by reading and processing the tailwind configuration file. | ||
--- | ||
---TODO: Support for v4 | ||
M.get_utilities = nil_wrap(vim.fn.TailwindGetUtilities) | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters