0.1.0 • Published 5 years ago

@aybolit/bulma v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Aybolit Bulma

Aybolit Bulma is a set of the web components inspired by Bulma CSS framework.

Overview

Bulma framework and Bulma-extensions are used as a base, but Aybolit does not preserve all the original CSS and makes certain adjustments. The main idea behind these changes is flexible theming support, with reasonable bundle size.

Installation

Aybolit Bulma is available as npm package:

# with npm
npm i @aybolit/bulma --save

# with yarn
yarn add @aybolit/bulma

Import either all or individual components:

// all components
import '@aybolit/bulma';

// button only
import { AbuButton } from '@aybolit/bulma';

You can also use get Aybolit Bulma from the CDN:

<script src="https://unpkg.com/@aybolit/bulma@latest?module" type="module"></script>

Components

Examples

<!-- Button -->
<abu-button>Button</abu-button>
<abu-button theme="primary">Primary theme</abu-button>
<abu-button size="small">Small size</abu-button>
<abu-button link="https://example.com">Link</abu-button>

<!-- Checkbox -->
<abu-checkbox>Unchecked</abu-checkbox>
<abu-checkbox checked>Checked</abu-checkbox>
<abu-checkbox indeterminate>Indeterminate</abu-checkbox>

<!-- Progress -->
<abu-progress value="50" max="100"></abu-progress>

<!-- Range -->
<abu-range min="0" max="10" value="5"></abu-range>

<!-- Switch -->
<abu-switch>Unchecked</abu-switch>
<abu-switch checked>Checked</abu-switch>

Theme Variants

All the components can be themed using theme attribute with one of the following values:

  • primary
  • info
  • success
  • warning
  • danger

The colors for each theme variant can be adjusted using custom CSS properties listed below.

Custom CSS Properties

The following custom CSS properties are available for styling.

General Theme

Changing these properties affect all the components at the level of cascade where they are specified. Keep in mind that lightness level is used as base for automatic contrast adjustment, so changing it might affect e.g. buttons text color.

PropertyDescription Fallback
--abu-primary-hPrimary color hue171
--abu-primary-sPrimary color saturation100
--abu-primary-lPrimary color lightness41
--abu-info-hInfo color hue204
--abu-info-sInfo color saturation86
--abu-info-lInfo color lightness48
--abu-success-hSuccess color hue141
--abu-success-sSuccess color saturation71
--abu-success-lSuccess color lightness48
--abu-warning-hWarning color hue48
--abu-warning-sWarning color saturation100
--abu-warning-lWarning color lightness67
--abu-danger-hDanger color hue348
--abu-danger-sDanger color saturation100
--abu-danger-lDanger color lightness48

Individual Components

These properties expose certain colors not covered by general theme settings.

ComponentPropertyDescription Fallback
Button--abu-button-bg-colorUn-themed button background#fff
Button--abu-button-border-colorUn-themed button border color#dbdbdb
Button--abu-button-colorUn-themed button color#363636
Button--abu-button-active-border-colorUn-themed active button border color#4a4a4a
Button--abu-button-hover-border-colorUn-themed hover button border color#b5b5b5
Checkbox--abu-checkbox-border-colorUnchecked state border color#dbdbdb
Progress--abu-progress-bar-colorProgress bar color#dbdbdb
Progress--abu-progress-value-colorUn-themed progress value color#4a4a4a
Range--abu-range-thumb-bgThumb background#fff
Range--abu-range-track-bgTrack background#b5b5b5
Switch--abu-switch-thumb-bgThumb background #fff
Switch--abu-switch-track-bgOff state track background #b5b5b5