Badge

Badge component pack for Seed

Install

npm install seed-badge --save

Dependencies


Example

Badge
<span class="c-badge">
  Badge
</span>

States

Error Info Success Warning
<span class="c-badge is-error">
  Error
</span>
<span class="c-badge is-info">
  Info
</span>
<span class="c-badge is-success">
  Success
</span>
<span class="c-badge is-warning">
  Warning
</span>

Custom colors

You can create custom colored badges by using the .t-bg- based classes from theme packs like seed-helpscout-theme.

Purple Orange Dark green
<span class="c-badge t-bg-purple-500">
  Purple
</span>
<span class="c-badge t-bg-orange-400">
  Orange
</span>
<span class="c-badge t-bg-green-900">
  Dark green
</span>

Configurations

Below are the default Sass configuration variables for seed-badge. The variables can be found in the pack’s _config.scss file.

seed-badge/_config.scss
// Namespace
$seed-badge-namespace: "c-badge" !default;

// Border
$seed-badge-border-radius: 2px !default;

// Colors
$seed-badge-background-color: #A5B2BD !default;
$seed-badge-text-color: #fff !default;

// Font
$seed-badge-font-size: 11px !default;
$seed-badge-font-weight: 600 !default;
$seed-badge-text-transform: uppercase !default;

// Padding
$seed-badge-padding: 4px 5px !default;

// Config for state prefix
// options: true || false
// if true, then badge states will compile with the defined state prefix
// Default is ".is-"
// Example:
// .is-success {
//   ...
// }
$seed-badge-enable-state-prefix: true !default;
$seed-badge-state-prefix: "is" !default;