Skip to content

otakustay/prism-color-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prism-color-variables

Extract prism colors to css variables

Usage

Theme variables does not include prism base styles, include it first.

You can optinally include a basic color theme in themes folder.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism.css">
<link rel="stylesheet" href="node_modules/prism-color-variables/variables.css">
<link rel="stylesheet" href="node_modules/prism-color-variables/themes/duracula.css">

Or using js imports:

import 'prismjs/themes/prism.css';
import 'prism-color-variables/variables.css';
import 'prism-color-variables/themes/duracula.css';

By using less it is possible to inline different themes:

@import (inline) "npm://prismjs/themes/prism.css";
@import (inline) "npm://prism-color-variables/themes/visual-studio.css";

@media (prefers-color-scheme: dark) {
    @import (inline) "npm://prism-color-variables/themes/duracula.css";
}

About

Extract prism colors to css variables

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages