1.2.0 • Published 2 years ago

@pedro_s/theme.js v1.2.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

theme.js

A theme library to help applications managing, loading and applying themes.

This library will create css variables for you.

This library will NOT create id's or classes for you.

Installing

npm i @pedro_s/theme.js

Supported

  • Variables
  • Transitions
  • Animations
  • Keyframes

Usage

Simple example of creating a theme

import ThemeJs from '@pedro_s/theme.js'
ThemeJs.CreateTheme("DarkMode", true)
ThemeJs.SetThemeValue("background", "#000")
ThemeJs.ApplyTheme()

Then to use a color all you have to do is add a var(--background) or var(--rgb-background) to your css or use it directly on your code using ThemeJs.CurrentTheme()["background"]

Development

To build the library all you have to do is run the following commands

  yarn
  yarn build