Skip to content

Instantly share code, notes, and snippets.

@u01jmg3
Created February 27, 2018 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u01jmg3/c6c82759e79673611c2bff8d30c2def4 to your computer and use it in GitHub Desktop.
Save u01jmg3/c6c82759e79673611c2bff8d30c2def4 to your computer and use it in GitHub Desktop.
Modify style of 'Pay with Card' Stripe button using Bootstrap Sass
  • Original Stripe button

stripe

  • With Bootstrap 3 styles applied

bootstrap

// Variables
$background: $btn-primary-bg;
$border: $btn-primary-border;
$radius: $btn-border-radius-base;
$important: !important;
.stripe-button-container {
.stripe-button-el {
@extend .btn;
@extend .btn-primary;
background-image: none;
border-radius: $radius;
border-style: solid;
border-width: 1px;
box-shadow: inherit;
padding: 1px;
// Custom icon
&::before {
@extend .glyphicon;
@extend .glyphicon-ok;
margin: 3px 2px 0 11px;
opacity: .8;
}
span {
background-color: inherit $important;
background-image: inherit $important;
box-shadow: inherit;
display: inherit $important;
font-family: inherit;
font-weight: inherit;
margin-bottom: 1px;
margin-top: 1px;
padding-left: 1.5px $important;
padding-right: 11px $important;
text-shadow: inherit $important;
}
&:focus,
&.focus,
&:hover,
&:active,
&.active { background-color: darken($background, 10%) $important }
&:focus,
&.focus { border-color: darken($border, 25%) }
&:hover,
&:active,
&.active { border-color: darken($border, 12%) }
&:active,
&.active {
&:hover,
&:focus,
&.focus {
background-color: darken($background, 17%) $important;
border-color: darken($border, 25%);
}
}
&.disabled,
&[disabled] {
background-color: $background $important;
border-color: $border;
opacity: .65 $important;
&:hover,
&:focus,
&.focus {
background-color: $background $important;
border-color: $border;
}
span { color: inherit }
}
}
.stripe-button-el.processing {
&::before {
@extend .glyphicon-cog;
@extend .icon-spin;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment