Socket
Socket
Sign inDemoInstall

switch-theme

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    switch-theme

Create custom theme for your tailwindcss project;


Version published
Weekly downloads
9
increased by350%
Maintainers
1
Install size
480 kB
Created
Weekly downloads
 

Readme

Source

switchTheme

Create custom theme for your tailwindcss project;

Installation

# Yarn
yarn add switch-theme --dev

# NPM
npm install switch-theme --dev

Usage

To start using this plugin you need to add it to your tailwind configuration file.

// tailwind.config.js

module.exports = {
	...
	plugins: [require('switch-theme')()],
}

Add Theme

In configuration file

const switchTheme = require('switch-theme');

module.exports = {
	customTheme: {
		light: {
			selector: '.light-theme',
			isDefault: true,
			scheme: {
				backgroundColor: {
					primary: '#0070F3',
	        warning: '#ECC94B',
	        danger: '#F56565',
				},
				textColor: {
					default: '#161b25',
					light: '#1d2331',
				},
			},
		},
		dark: {
			selector: '.dark-theme',
			scheme: {
				textColor: {
					default: '#F7FAFC',
					light: '#EDF2F7',
				},
			},
		},
	},
	plugins: [switchTheme()],
}

and in your project

<div class="bg-primary text-default bg-opacity-75">
	...
</div>

FAQs

Last updated on 16 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc