Skip to content

Commit

Permalink
Merge pull request #1416 from pat270/clay-1415
Browse files Browse the repository at this point in the history
Fixes #1415 - ClayCSS Custom Checkbox / Radio calculate spacing based…
  • Loading branch information
marcoscv-work authored Jan 8, 2019
2 parents 4e9d312 + 6cb1b8d commit 6de4313
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ $custom-control-indicator-indeterminate-border-color: $custom-control-indicator-

$custom-control-description-font-size: $input-label-font-size !default; // 13px
$custom-control-description-disabled-color: $input-label-disabled-color !default;
$custom-control-description-line-height: $custom-control-indicator-size + ($custom-control-indicator-border-width * 2) !default;

// Custom Checkbox

Expand Down
8 changes: 7 additions & 1 deletion packages/clay-css/src/scss/components/_custom-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
// Custom Checkbox and Radio

.custom-control {
margin-bottom: $custom-control-margin-bottom;
margin-top: $custom-control-margin-top;
min-height: $custom-control-min-height;

label {
cursor: $custom-control-description-cursor;
font-size: $font-size-base;
Expand Down Expand Up @@ -91,10 +95,12 @@ label.custom-control-label {
border-width: $custom-control-indicator-border-width;
font-size: $custom-control-indicator-size;
left: 0;
top: $custom-control-indicator-position-top;
}

.custom-control-label::after {
left: 0;
top: $custom-control-indicator-position-top;
}

.custom-control-input {
Expand Down Expand Up @@ -193,7 +199,7 @@ label.custom-control-label {
.custom-control-input {
height: $custom-control-indicator-size;
left: 0;
top: (($line-height-base - $custom-control-indicator-size) / 2);
top: $custom-control-indicator-position-top;
width: $custom-control-indicator-size;
z-index: 0;
}
Expand Down
11 changes: 9 additions & 2 deletions packages/clay-css/src/scss/variables/_custom-forms.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$custom-control-indicator-border-color: null !default;
$custom-control-indicator-border-style: null !default;
$custom-control-indicator-border-width: null !default;
$custom-control-indicator-position-top: 0.25rem !default;

$custom-control-indicator-active-border-color: null !default;

Expand Down Expand Up @@ -31,11 +32,17 @@ $custom-control-indicator-checked-disabled-border-color: $custom-control-indicat

$custom-control-indicator-indeterminate-border-color: null !default;

// Custom Control

$custom-control-margin-bottom: null !default;
$custom-control-margin-top: null !default;
$custom-control-min-height: $custom-control-indicator-size + ($custom-control-indicator-position-top * 2) !default;

// Custom Description

$custom-control-description-cursor: $form-check-label-cursor !default;
$custom-control-description-font-size: null !default;
$custom-control-description-line-height: $custom-control-indicator-size !default;
$custom-control-description-font-size: 1rem !default; // 16px
$custom-control-description-line-height: $custom-control-min-height !default;
$custom-control-description-padding-left: 0.5rem !default; // 8px
$custom-control-description-disabled-cursor: $disabled-cursor !default;

Expand Down

0 comments on commit 6de4313

Please sign in to comment.