Skip to content

Commit

Permalink
fix(custom-forms): fix doc for disabled custom checkboxes and radio
Browse files Browse the repository at this point in the history
  • Loading branch information
Lausselloic committed Jan 5, 2018
1 parent 508ead2 commit d10d25c
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 65 deletions.
24 changes: 8 additions & 16 deletions _includes/boostwatch/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,25 @@ <h2 id="forms">Forms<a class="doc-link" href="../components/forms/" title="go to
<div>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input">
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange checkbox unchecked</span>
<span class="custom-control-label">Orange checkbox unchecked</span>
</label>
</div>
<div>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" disabled>
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange checkbox unchecked disabled</span>
<span class="custom-control-label">Orange checkbox unchecked disabled</span>
</label>
</div>
<div>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" checked>
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange checkbox checked</span>
<span class="custom-control-label">Orange checkbox checked</span>
</label>
</div>
<div>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" checked disabled>
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange checkbox checked disabled</span>
<span class="custom-control-label">Orange checkbox checked disabled</span>
</label>
</div>
</div>
Expand All @@ -60,29 +56,25 @@ <h2 id="forms">Forms<a class="doc-link" href="../components/forms/" title="go to
<div>
<label class="custom-control custom-radio">
<input id="radio1" name="radio" type="radio" class="custom-control-input" checked>
<span class="custom-control-label"></span>
<span class="custom-control-description">Toggle this custom radio</span>
<span class="custom-control-label">Toggle this custom radio</span>
</label>
</div>
<div>
<label class="custom-control custom-radio">
<input id="radio2" name="radio" type="radio" class="custom-control-input">
<span class="custom-control-label"></span>
<span class="custom-control-description">Or toggle this other custom radio</span>
<span class="custom-control-label">Or toggle this other custom radio</span>
</label>
</div>
<div>
<label class="custom-control custom-radio">
<input id="radio3" name="radio-disabled" type="radio" class="custom-control-input" checked disabled>
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange radio checked disabled</span>
<span class="custom-control-label">Orange radio checked disabled</span>
</label>
</div>
<div>
<label class="custom-control custom-radio">
<input id="radio4" name="radio-disabled" type="radio" class="custom-control-input" disabled>
<span class="custom-control-label"></span>
<span class="custom-control-description">Orange radio unchecked disabled</span>
<span class="custom-control-label">Orange radio unchecked disabled</span>
</label>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/css/boosted-grid.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/boosted-reboot.css.map

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions dist/css/boosted-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/boosted-rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/boosted-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/boosted-rtl.min.css.map

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions dist/css/boosted.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/boosted.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/boosted.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/boosted.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/orangeHelvetica.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/orangeIcons.css.map

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions scss/_custom-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@

&:checked ~ .custom-control-label::before {
color: $custom-control-indicator-checked-color;
// our custom control have a border
border-color: $custom-control-indicator-checked-border-color;
// end mod
@include gradient-bg($custom-control-indicator-checked-bg);
@include box-shadow($custom-control-indicator-checked-box-shadow);
// Boosted mod move gradient to global settings, to change the color for disabled checked elements
&::before {
@include gradient-bg($custom-control-indicator-checked-bg);
}
// end mod
}

&:focus ~ .custom-control-label::before {
Expand All @@ -52,13 +60,18 @@
color: $custom-control-label-disabled-color;

&::before {
background-color: $custom-control-indicator-disabled-bg;
// Boosted mod
// our custom control have a border
border-color: $gray-500;
// end mod
}
}
// Boosted mod disable bg only for checked elements
&:checked ~ .custom-control-label {
&::before {
background-color: $custom-control-indicator-disabled-bg;
}
}
}
}

Expand Down Expand Up @@ -116,13 +129,7 @@
}

.custom-control-input:checked ~ .custom-control-label {
&::before {
// Boosted mod
// our custom control have a border
border-color: $custom-control-indicator-checked-border-color;
// end mod
@include gradient-bg($custom-control-indicator-checked-bg);
}
// Boosted mod move ::before gradient to global definition
&::after {
background-image: $custom-checkbox-indicator-icon-checked;
}
Expand Down Expand Up @@ -159,13 +166,7 @@
}

.custom-control-input:checked ~ .custom-control-label {
&::before {
// Boosted mod
// our custom control have a border
border-color: $custom-control-indicator-checked-border-color;
// end mod
@include gradient-bg($custom-control-indicator-checked-bg);
}
// Boosted mod move ::before gradient to global definition
&::after {
background-image: $custom-radio-indicator-icon-checked;
}
Expand All @@ -184,6 +185,7 @@
width: 100%;
height: $input-height;
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
font-weight: 700; // boosted mod set font-weight bold
line-height: $custom-select-line-height;
color: $custom-select-color;
vertical-align: middle;
Expand Down
4 changes: 2 additions & 2 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ $custom-control-indicator-bg: $white !default;
$custom-control-indicator-bg-size: 1rem !default;
$custom-control-indicator-box-shadow: none !default;

$custom-control-indicator-disabled-bg: $white !default;
$custom-control-indicator-disabled-bg: $gray-500 !default;
$custom-control-label-disabled-color: #767676 !default;

$custom-control-indicator-checked-color: $white !default;
Expand All @@ -529,7 +529,7 @@ $custom-checkbox-indicator-icon-indeterminate: url("data:image/svg+xml;charset=u
$custom-checkbox-indicator-indeterminate-box-shadow: none !default;

$custom-radio-indicator-border-radius: 50% !default;
$custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E"), "#", "%23") !default;
$custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E"), "#", "%23") !default;

$custom-select-padding-y: .4375rem !default;
$custom-select-padding-x: .5rem !default;
Expand Down

0 comments on commit d10d25c

Please sign in to comment.