Skip to content

Commit

Permalink
feat(extras): add prism colorscheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jul 15, 2024
1 parent 3eb5b07 commit a6c8fe1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/astrotheme/extras/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ M.extras = {
kitty = { ext = "conf", url = "https://sw.kovidgoyal.net/kitty/conf.html", label = "Kitty" },
lazygit = { ext = "yml", url = "https://github.com/jesseduffield/lazygit", label = "Lazygit" },
lua = { ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing" },
prism = { ext = "js", url = "https://prismjs.com", label = "Prism" },
slack = {ext = "txt", url = "https://slack.com", label = "Slack"},
spotify_player = {ext = "toml", url = "https://github.com/aome510/spotify-player", label = "Spotify Player"},
st = {ext = "h", url = "https://st.suckless.org/", label = "simple terminal"},
Expand Down
65 changes: 65 additions & 0 deletions lua/astrotheme/extras/prism.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
local util = require "astrotheme.extras"

local M = {}

--- @param colors AstroThemePalette
function M.generate(colors)
return util.template(
[[
module.exports = {
plain: {
color: "${syntax.text}",
backgroundColor: "${ui.base}",
},
styles: [
{
types: ["prolog", "builtin"],
style: {
color: "${syntax.red}",
},
},
{
types: ["function", "symbol", "tag"],
style: {
color: "${syntax.blue}",
},
},
{
types: ["punctuation", "variable"],
style: {
color: "${syntax.text}",
},
},
{
types: ["string", "char", "selector"],
style: {
color: "${syntax.green}",
},
},
{
types: ["keyword", "operator"],
style: {
color: "${syntax.purple}",
},
},
{
types: ["constant", "boolean", "attr-name"],
style: {
color: "${syntax.yellow}",
},
},
{
types: ["comment"],
style: {
color: "${syntax.comment}",
fontStyle: "italic",
},
},
],
};
]],
colors
)
end

return M

0 comments on commit a6c8fe1

Please sign in to comment.