feat(extras): added prism.js themes

This commit is contained in:
Folke Lemaitre
2023-01-18 15:06:08 +01:00
parent 039b304bf6
commit 14ca396af0
6 changed files with 395 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ function M.setup()
sublime = "tmTheme",
delta = "gitconfig",
terminator = "conf",
prism = "js",
}
-- map of style to style name
local styles = {
@@ -38,6 +39,7 @@ function M.setup()
}
for extra, ext in pairs(extras) do
package.loaded["tokyonight.extra." .. extra] = nil
local plugin = require("tokyonight.extra." .. extra)
for style, style_name in pairs(styles) do
config.setup({ style = style })

View File

@@ -0,0 +1,89 @@
local util = require("tokyonight.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
return util.template(M.template, colors)
end
M.template = [[
module.exports = {
plain: {
color: "${fg}",
backgroundColor: "${bg}",
},
styles: [
{
types: ["prolog", "builtin"],
style: {
color: "${red}",
},
},
{
types: ["function"],
style: {
color: "${blue}",
},
},
{
types: ["symbol"],
style: {
color: "${blue1}",
},
},
{
types: ["punctuation"],
style: {
color: "${magenta}",
},
},
{
types: ["string", "char", "tag", "selector"],
style: {
color: "${green}",
},
},
{
types: ["keyword"],
style: {
color: "${magenta}",
fontStyle: "italic",
},
},
{
types: ["operator"],
style: {
color: "${blue5}",
},
},
{
types: ["constant", "boolean"],
style: {
color: "${orange}",
},
},
{
types: ["variable"],
style: {
color: "${fg}",
},
},
{
types: ["comment"],
style: {
color: "${comment}",
fontStyle: "italic",
},
},
{
types: ["attr-name"],
style: {
color: "rgb(241, 250, 140)",
},
},
],
};
]]
return M