Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coffeekraken/s-theme

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coffeekraken/s-theme

Central class to handle your theme in the Coffeekraken toolchain. It allows you to switch theme|variant, list available themes, etc...

  • 2.0.0-beta.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

{% extends 'sugar/readme/layouts/main/main.twig' %} {% block body %}

STheme

This class allows you to access and manipulate all theme things like accessing configurations, override some, changing theme, etc...

Usage

Here's how to use our implementation:

import __STheme from '@coffeekraken/s-theme';

// Get the current theme
const theme = __STheme.getCurrentTheme();

// apply a theme variant
__STheme.setThemeVariant('dark'); // apply dark mode

// Override a color (DOM only)
__STheme.setColor('accent', '#ff0000');

// Access a color
const color = __STheme.getColor('complementary');

// Get the current theme hash
const hash = __STheme.hash();

// remapping a color to another and get back the css vars
const vars = __STheme.remapCssColor('accent', 'error');

// loop on all the theme colors
__STheme.loopOnColors((colorObj) => {
    console.log(colorObj);
    // {
    //      name: ...
    //      schema: ...
    //      value: {}
    // }
});

// and more...

API's

This package has two distinct API. One for the browser platform, and the other for the node one.

  • Check out this doc for browser integration
  • Check out this doc for node integration
  • Check out this doc for shared integration

For more information about the API of this class, please check our API documentation

{% endblock %}

FAQs

Package last updated on 15 Sep 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc