Socket
Socket
Sign inDemoInstall

datocms-plugin-theme-selector

Package Overview
Dependencies
103
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    datocms-plugin-theme-selector

A plugin for DatoCMS that allows you select a color from a predefined list.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

DatoCMS Theme Selector

A plugin for DatoCMS that allows you select a color from a predefined list. The normal color field opens a color picker, but doesn't enforce a fixed set of colors.

Example

Configuration

Make sure you apply the plugin on a color field, and fill out the preset color list. You can define a default set of colors globally, and override them on an instance. Use the global option if you have default set of values you should be able to select from.

A valid list of colors could look like this:

#feb2b2, #fc8181, #f56565, #e53e3e, #c53030

Querying

The plugin is using the color field, which means you have access to a color object.

query ArticleQuery {
  allArticles {
    theme {
      hex
      red
      green
      blue
      alpha
    }
  }
}

If you just need the hex value, like you added in the settings, you can limit your query lookup for that value.

query ArticleQuery {
  allArticles {
    theme {
      hex
    }
  }
}

Development

The plugin is built using Vite.js. This enables a fast development workflow, where you see the changes as soon as you save a file. For it to work, it needs to be rendered inside the DatoCMS interface.

So when testing the plugin locally, you should create a new plugin in a DatoCMS project, and point it to http://localhost:3000.

Example

Keywords

FAQs

Last updated on 16 Apr 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc