0.1.0 • Published 3 years ago

@solomondefi/plugin v0.1.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

Installation

With NPM/Bundler (Vue3, React, vanilla JS, etc.)

npm i -S @solomondefi/plugin

Without Bundler (Browser)

It is recommended to download the distribution and copy plugin.umd.js into your project.

For testing and prototyping, you can include it from the Unpkg CDN:

<script src="https://unpkg.com/@solomondefi/plugin@0.1.0/dist/plugin.umd.js>

Usage

Basic usage, for advanced options see Configuration

Vue3

<template>
  <SlmPlugin
    :show="true"
  />
</template>

<script>
import { SlmPlugin } from '@solomon/plugin';

export default {
  components: { SlmPlugin },
};
</script>

React

TBD

Vanilla JS

TBD

Configuration

TBD

Theming

Style

TBD

Fonts

The plugin uses @font-face definitions for title and text fonts called SlmTitle and SlmText, respectively. We recommend Montserrat and PTSerif, which are included in the library. They are not included in the SlmPlugin widget automatically to avoid bloating, but can be easily imported if you're using PostCSS or another CSS preprocessor:

@import '/node_modules/@solomon/plugin/dist/font.css';

Font files are located at dist/fonts.

Another option is to manually define the necessary typefaces before including the plugin:

@font-face {
  font-family: 'SlmTitle';
  src: /* Regular title font */
  font-weight: 400;
}

@font-face {
  font-family: 'SlmTitle';
  src: /* Medium title font */
  font-weight: 500;
}

@font-face {
  font-family: 'SlmTitle';
  src: /* Bold title font */
  font-weight: 700;
}

@font-face {
  font-family: 'SlmText';
  src: /* Regular text font */
  font-weight: 400;
}

Examples

See the examples directory.

Run Vue3 example:

npm run dev

Contributing

License

MIT License © 2021 Solomon Defi