Skip to content

Commit

Permalink
fix(buttons): update btn-alert variants
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmatthew committed Oct 6, 2020
1 parent 162dc99 commit 3f946f2
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 5 deletions.
4 changes: 4 additions & 0 deletions assets/stylesheets/bootstrap/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ a.btn {
@include button-variant-alert();
}

.btn-alert--primary {
@include button-variant-alert--primary();
}


// Link buttons
// -------------------------
Expand Down
4 changes: 3 additions & 1 deletion assets/stylesheets/bootstrap/mixins/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
a {
color: $text-color;
}

.btn-alert {
text-decoration: none;

&:hover {
color: $white !important;
color: currentColor !important;
}
}
}
80 changes: 77 additions & 3 deletions assets/stylesheets/bootstrap/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
border-color: $black;

&:hover {
background-color: $black;
color: $white;
background-color:rgba(0,0,0,0.1);
color: $black;
border-color: $black;
}

Expand All @@ -186,7 +186,7 @@
&.active,
.open > &.dropdown-toggle {
color: $black;
background-color: transparent;
background-color: rgba(0,0,0,0.1);
border-color: $black;
box-shadow:
0px 0px 0px 1px $black,
Expand All @@ -200,9 +200,83 @@
}

&:hover:active {
background-color: rgba(0,0,0,0.1);
color: $black;
}

&.disabled,
&[disabled],
fieldset[disabled] {
background-color: #ADB5BD;
border-color: #ADB5BD;
color: $white;
box-shadow: none;
}

&.disabled,
&[disabled],
&[disabled]:active,
fieldset[disabled] & {
// pointer-events: none;

&:hover,
&:focus,
&.focus {
background-color: #ADB5BD;
border-color: #ADB5BD;
color: $white;
box-shadow: none;
}
}
}

@mixin button-variant-alert--primary() {
color: $white;
background-color: $black;
border-color: $black;

&:hover {
background-color: $gray800;
color: $white;
border-color: $black;
}

&:focus,
&.focus {
color: $white;
border-color: $black;
box-shadow:
0px 0px 0px 1px $white,
0px 0px 0px 2px $black,
}

&:hover:focus {
color: $white;
background-color: $black;
}

&:active,
&.active,
.open > &.dropdown-toggle {
color: $white;
background-color: $gray800;
border-color: $black;
box-shadow:
0px 0px 0px 1px $white,
0px 0px 0px 2px $gray800;
}

&:active,
&.active,
.open > &.dropdown-toggle {
background-image: none;
}

&:hover:active {
background-color: #gray800;
color: $white;
}

&.disabled,
&[disabled],
fieldset[disabled] {
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ <h2>Dropdowns</h2>
<h2>Alerts</h2>
<!-- Basic -->
<div class="alert alert-info">
<span>Something has happened. Yup.</span> <button class="btn btn-alert">Click me</button>
<span>Something has happened. Yup.</span> <button class="btn btn-alert">Click me</button> <button class="btn btn-alert--primary">Click me</button>
</div>

<!-- Success -->
Expand Down

0 comments on commit 3f946f2

Please sign in to comment.