Fields Group

Installation

  yarn add @chewy/kib-fields-styles

Import

  @use '~@chewy/kib-fields-styles/src/kib-input-group/styles' as kib-input-group;

Mixins

root-container

@mixin root-container() { ... }@mixin root-container() { 
  padding: 0;
  border: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: spacing.get('s2');
 }
Description

Root container

Parameters

None.

Requires

label

@mixin label() { ... }@mixin label() { 
  position: relative;
  @include typography.style-as(settings.$field-group-legend-typography);

  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: spacing.get('s4');
 }
Description

Styles for the label of a container of a collection of related fields.

Parameters

None.

Requires

label-with-message

@mixin label-with-message() { ... }@mixin label-with-message() { 
  margin-bottom: spacing.get('s2');
 }
Description

Styles for the label of a container of a collection of related fields.

Parameters

None.

Requires

help

@mixin help() { ... }@mixin help() { 
  @include typography.style-as('form-helper');

  order: 0;
  color: settings.$help-text-color;
  margin-top: 0;
  margin-bottom: spacing.get('s4');
 }
Description

Helper text

Parameters

None.

Requires

help-bottom

@mixin help-bottom() { ... }@mixin help-bottom() { 
  order: 3;
  margin-top: spacing.get('s4');
  margin-bottom: 0;
 }
Description

Helper text when on bottom position

Parameters

None.

Requires

content

@mixin content() { ... }@mixin content() { 
  gap: spacing.get('s2');
  display: flex;
  flex-direction: column;
 }
Description

Content spacing positioning

Parameters

None.

Requires

alert

@mixin alert() { ... }@mixin alert() { 
  margin-bottom: spacing.get('s3');
 }
Description

Custom alert message

Parameters

None.

Requires

icon

@mixin icon() { ... }@mixin icon() { 
  $style: 'form-grouping';
  $line-height: typography.get($style, 'line-height');
  $font-size: typography.get($style, 'font-size');

  display: inline-block;
  flex-shrink: 0;
  width: calc(#{$line-height} * #{$font-size});
  height: calc(#{$line-height} * #{$font-size});
  margin-right: spacing.get('s2');
 }
Description

Field icon

Parameters

None.

Requires

error

@mixin error() { ... }@mixin error() { 
  order: 5;
 }
Description

Error wrapper

Parameters

None.

error-message

@mixin error-message() { ... }@mixin error-message() { 
  @include typography.style-as(settings.$error-message-token-size);

  display: flex;
  margin-top: spacing.get('s1');
  color: settings.$error-text-color;
 }
Description

Error message

Parameters

None.

Requires

error-icon

@mixin error-icon() { ... }@mixin error-icon() { 
  margin-right: spacing.get('s1');
  width: settings.$error-icon-size;
  height: settings.$error-icon-size;
  color: currentColor;
 }
Description

Error icon

Parameters

None.

Requires

group-label

@mixin group-label() { ... }@mixin group-label() { 
  @include typography.style-as('section-1');

  margin-bottom: spacing.get('s4');
 }
Description

Styles for the label of a container of a collection of related fields.

Parameters

None.

Requires

group-messages-above

@mixin group-messages-above() { ... }@mixin group-messages-above() { 
  @include typography.style-as('caption');

  margin-bottom: spacing.get('s4');
 }
Description

Styles for the messages be below the header but above the fields.

Parameters

None.

Requires

group-messages-below

@mixin group-messages-below() { ... }@mixin group-messages-below() { 
  @include typography.style-as('caption');

  margin-top: spacing.get('s4');
 }
Description

Styles for the messages below the fields.

Parameters

None.

Requires

reset-fieldset-styling

@mixin reset-fieldset-styling() { ... }@mixin reset-fieldset-styling() { 
  padding: 0;
  border: 0;
  margin: 0;
 }
Description

Removing default styling for fieldsets

Parameters

None.