2017-07-12 21:09:15 +03:00
// stylelint-disable selector-max-type, block-opening-brace-space-before, no-duplicate-selectors
2017-05-11 07:56:23 +03:00
// Base button styles
. btn {
position : relative ;
display : inline-block ;
padding : 6 px 12 px ;
font-size : $body-font-size ;
font-weight : $font-weight-bold ;
line-height : 20 px ; // Specifically not inherit our `<body>` default
white-space : nowrap ;
vertical-align : middle ;
cursor : pointer ;
user-select : none ;
background-repeat : repeat-x ;
background-position : - 1 px - 1 px ;
background-size : 110 % 110 % ;
border : 1 px solid transparentize ( $black , 0 .8 ) ;
border-radius : 0 .25 em ;
appearance : none ; // Corrects inability to style clickable `input` types in iOS.
i {
font-style : normal ;
2017-07-18 02:56:14 +03:00
font-weight : $font-weight-semibold ;
2017-12-23 01:05:00 +03:00
opacity : 0 .75 ;
2017-05-11 07:56:23 +03:00
}
. octicon {
vertical-align : text-top ;
}
// Darken for just a tad more contrast against the button background
2017-06-08 03:53:57 +03:00
. Counter {
2017-05-11 07:56:23 +03:00
color : $gray-600 ;
text-shadow : none ;
background-color : rgba ( $black , 0 .1 ) ;
}
& : hover {
text-decoration : none ;
background-repeat : repeat-x ;
}
& : focus {
outline : 0 ;
}
& : disabled ,
& . disabled {
cursor : default ;
// Repeat `background-position` because `:hover`
background-position : 0 0 ;
}
& : active ,
& . selected {
background-image : none ;
}
}
. btn { @include btn-solid ( $text-gray-dark , $gray-000 , darken ( $gray-100 , 2 % )) ; }
. btn-primary { @include btn-solid ( $text-white , $green-400 , $green-500 ) ; }
. btn-purple { @include btn-solid ( $text-white , lighten ( $purple-500 , 5 % ) , darken ( $purple-500 , 5 % )) ; }
. btn-blue { @include btn-solid ( $text-white , lighten ( $blue-500 , 8 % ) , darken ( $blue-500 , 2 % )) ; }
. btn-danger { @include btn-inverse ( $red-600 , $gray-000 , darken ( $gray-100 , 2 % )) ; }
// Outline button
//
// For when we need a linky-action that's not too heavy in busier
// areas like conversation timelines.
. btn-outline {
@include btn-outline ( $text-blue ) ;
}
// Social button count
. btn-with-count {
float : left ;
border-top-right-radius : 0 ;
border-bottom-right-radius : 0 ;
}
// Minibutton overrides
//
// Tweak `line-height` to make them smaller.
. btn-sm {
padding : 3 px 10 px ;
font-size : $font-size-small ;
line-height : 20 px ;
}
// Large button adds more padding around text. Use font-size utils to increase font-size.. e.g, <p class="text-gamma"><button class="btn btn-large btn-primary" type="button">Big green button</button></p>
. btn-large {
2018-01-06 01:55:47 +03:00
padding : $em-spacer-6 1 .25 em ;
2017-05-11 07:56:23 +03:00
font-size : inherit ;
border-radius : 6 px ;
}
// Hidden text button
//
// Use `.hidden-text-expander` to indicate and expand hidden text.
. hidden-text-expander {
display : block ;
& . inline {
position : relative ;
top : - 1 px ;
display : inline-block ;
margin-left : 5 px ;
line-height : 0 ;
}
}
. hidden-text-expander a ,
. ellipsis-expander {
display : inline-block ;
height : 12 px ;
padding : 0 5 px 5 px ;
2017-07-18 02:31:19 +03:00
font-size : $font-size-small ;
2017-05-11 07:56:23 +03:00
font-weight : $font-weight-bold ;
line-height : 6 px ;
color : $gray-700 ;
text-decoration : none ;
vertical-align : middle ;
background : lighten ( $gray-300 , 5 % ) ;
border : 0 ;
border-radius : 1 px ;
& : hover {
text-decoration : none ;
background-color : darken ( $gray-300 , 4 % ) ;
}
& : active {
color : $text-white ;
background-color : $blue-400 ;
}
}
// Social count bubble
//
// A container that is used for social bubbles counts.
. social-count {
float : left ;
padding : 3 px 10 px ;
font-size : $font-size-small ;
font-weight : $font-weight-bold ;
line-height : 20 px ;
color : $text-gray-dark ;
vertical-align : middle ;
background-color : $bg-white ;
border : 1 px solid transparentize ( $black , 0 .8 ) ; // match with .btn
border-left : 0 ;
border-top-right-radius : 3 px ;
border-bottom-right-radius : 3 px ;
& : hover ,
& : active {
text-decoration : none ;
}
& : hover {
color : $text-blue ;
cursor : pointer ;
}
}
// Full-width button
//
// These buttons expand to the full width of their parent container
. btn-block {
display : block ;
width : 100 % ;
text-align : center ;
}
2018-11-16 00:31:41 +03:00
// Link-like buttons
2017-05-11 07:56:23 +03:00
//
2018-11-16 00:31:41 +03:00
// This class is for styling <button> and <input> elements to look like links
2017-05-11 07:56:23 +03:00
. btn-link {
display : inline-block ;
padding : 0 ;
font-size : inherit ;
color : $text-blue ;
text-decoration : none ;
white-space : nowrap ;
cursor : pointer ;
user-select : none ;
background-color : transparent ;
border : 0 ;
appearance : none ; // Corrects inability to style clickable `input` types in iOS.
& : hover {
text-decoration : underline ;
}
& : disabled {
& ,
& : hover {
color : rgba ( $gray-600 , 0 .5 ) ;
cursor : default ;
}
}
}
2017-10-16 11:43:42 +03:00
. details-reset {
// Remove marker added by the display: list-item browser default
> summary { list-style : none ; }
// Remove marker added by details polyfill
> summary : : before { display : none ; }
// Remove marker added by Chrome
> summary : : -webkit-details-marker { display : none ; }
}