Option card

Option card component pack for Seed

Install

npm install seed-option-card --save

Dependencies


Example

.c-option-card provides a wrapper for a traditional input radio or checkbox.

Pick One:
<div class="tx-h6 tx-700 u-op-2 u-mrg-b-1">Pick One:</div>
<div class="c-option-card u-mrg-b-2">
  <label class="c-option-card__label">
    <input type="radio" class="c-option-card__selector" name="example">
    <div class="c-card">
      <div class="c-card__block">
        <div class="tx-h4">Pick Me</div>
        Cause I'm the best.
      </div>
    </div>
  </label>
</div>
<div class="c-option-card">
  <label class="c-option-card__label">
    <input type="radio" class="c-option-card__selector" name="example" />
    <div class="c-card">
      <div class="c-card__block">
        <div class="tx-h4">No, Pick Me</div>
        Cause I'm the better!
      </div>
    </div>
  </label>
</div>
<div class="c-option-card">
  <label class="c-option-card__label">
    <input type="radio" class="c-option-card__selector" name="example" />
    <div class="c-card">
      <div class="c-card__block">...</div>
    </div>
  </label>
</div>

Control Group

Pick One:
<div class="tx-h6 tx-700 u-op-2 u-mrg-b-1">Pick One:</div>
<div class="o-control-group">
  <div class="c-option-card u-mrg-b-2">
    <label class="c-option-card__label">
      <input type="radio" class="c-option-card__selector" name="example">
      <div class="c-card">
        <div class="c-card__block">
          Option 1
        </div>
      </div>
    </label>
  </div>
  <div class="c-option-card">
    <label class="c-option-card__label">
      <input type="radio" class="c-option-card__selector" name="example" />
      <div class="c-card">
        <div class="c-card__block">
          Option 2
        </div>
      </div>
    </label>
  </div>
  <div class="c-option-card">
    <label class="c-option-card__label">
      <input type="radio" class="c-option-card__selector" name="example" />
      <div class="c-card">
        <div class="c-card__block">
          Option 3
        </div>
      </div>
    </label>
  </div>
</div>
<div class="o-control-group">
  <div class="c-option-card">...</div>
  <div class="c-option-card">...</div>
  <div class="c-option-card">...</div>
</div>

Configurations

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

seed-option-card/_config.scss
// Namespaces
$seed-option-card-namespace: c-option-card !default;
$seed-option-card-label-namespace: #{$seed-option-card-namespace}__label !default;
$seed-option-card-selector-namespace: #{$seed-option-card-namespace}__selector !default;

// Config
$seed-option-card-background-color-active: rgba(black, 0.025) !default;
$seed-option-card-border-color: #ddd !default;
$seed-option-card-border-hover-color: #ccc !default;
$seed-option-card-border-focus-color: #3197D6 !default;
$seed-option-card-box-shadow-focus: 0 0 0 2px rgba($seed-option-card-border-focus-color, 0.2) !default;
$seed-option-card-border-size-focus: 2px !default;