Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: Form vars #21441

Merged
merged 3 commits into from
Dec 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions scss/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ select.form-control {
margin-bottom: 0; // match inputs if this class comes on inputs with default margins
line-height: $input-line-height;
border: solid transparent;
border-width: 1px 0;
border-width: $input-btn-border-width 0;

&.form-control-sm,
&.form-control-lg {
Expand Down Expand Up @@ -192,7 +192,7 @@ select.form-control-lg {

.form-text {
display: block;
margin-top: ($spacer * .25);
margin-top: $form-text-margin-top;
}


Expand All @@ -203,12 +203,7 @@ select.form-control-lg {
.form-check {
position: relative;
display: block;
margin-bottom: ($spacer * .75);

// Move up sibling radios or checkboxes for tighter spacing
+ .form-check {
margin-top: -.25rem;
}
margin-bottom: $form-check-margin-bottom;

&.disabled {
.form-check-label {
Expand All @@ -219,15 +214,15 @@ select.form-control-lg {
}

.form-check-label {
padding-left: 1.25rem;
padding-left: $form-check-input-gutter;
margin-bottom: 0; // Override default `<label>` bottom margin
cursor: pointer;
}

.form-check-input {
position: absolute;
margin-top: .25rem;
margin-left: -1.25rem;
margin-top: $form-check-input-margin-y;
margin-left: -$form-check-input-gutter;

&:only-child {
position: static;
Expand All @@ -243,7 +238,7 @@ select.form-control-lg {
}

+ .form-check-inline {
margin-left: .75rem;
margin-left: $form-check-inline-margin-x;
}
}

Expand All @@ -253,7 +248,7 @@ select.form-control-lg {
// Apply contextual and semantic states to individual form controls.

.form-control-feedback {
margin-top: ($spacer * .25);
margin-top: $form-feedback-margin-top;
}

.form-control-success,
Expand Down Expand Up @@ -365,6 +360,8 @@ select.form-control-lg {
}
.form-check-input {
position: relative;
margin-top: 0;
margin-right: $form-check-input-margin-x;
margin-left: 0;
}

Expand All @@ -378,7 +375,7 @@ select.form-control-lg {
.custom-control-indicator {
position: static;
display: inline-block;
margin-right: .25rem; // Flexbox alignment means we lose our HTML space here, so we compensate.
margin-right: $form-check-input-margin-x; // Flexbox alignment means we lose our HTML space here, so we compensate.
vertical-align: text-bottom;
}

Expand Down
11 changes: 11 additions & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ $input-height-sm: (($font-size-sm * $line-height-sm) + ($input-pa

$input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;

$form-text-margin-top: .25rem !default;
$form-feedback-margin-top: $form-text-margin-top !default;

$form-check-margin-bottom: .5rem !default;
$form-check-input-gutter: 1.25rem !default;
$form-check-input-margin-y: .25rem !default;
$form-check-input-margin-x: .25rem !default;

$form-check-inline-margin-x: .75rem !default;

$form-group-margin-bottom: $spacer-y !default;

$input-group-addon-bg: $gray-lighter !default;
Expand All @@ -461,6 +471,7 @@ $custom-control-spacer-x: 1rem !default;
$custom-control-spacer-y: .25rem !default;

$custom-control-indicator-size: 1rem !default;
$custom-control-indicator-margin-y: (($line-height-base * 1rem) - $custom-control-indicator-size) / -2 !default;
$custom-control-indicator-bg: #ddd !default;
$custom-control-indicator-bg-size: 50% 50% !default;
$custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black,.1) !default;
Expand Down