Instantly share code, notes, and snippets.
Last active
September 30, 2019 17:16
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save Narga/12025edcd999bc69a37a73d98599c08e to your computer and use it in GitHub Desktop.
Simple, Beauty CSS Buttons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple & Beauty CSS Buttons | |
* Author URI: https://www.narga.net/ | |
*/ | |
.btn { | |
font-size: 14px; | |
line-height: 20px; | |
position: relative; | |
display: inline-block; | |
box-sizing: border-box; | |
min-height: 34px; | |
padding: 6px 12px; | |
cursor: pointer; | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
transition: background-color .25s ease, border-color .25s ease, color .25s ease; | |
text-align: center; | |
vertical-align: middle; | |
white-space: normal; | |
text-decoration: none; | |
color: #fff; | |
border: 1px solid #434a54; | |
border-radius: 3px; | |
background: #656d78; | |
text-rendering: optimizeSpeed; | |
-webkit-appearance: none; | |
-webkit-font-smoothing: antialiased; | |
} | |
.btn:hover { | |
border-color: #434a54; | |
background-color: #434a54; | |
} | |
.btn::-moz-focus-inner { | |
margin: 0; | |
padding: 0; | |
} | |
.btn:focus { | |
outline: 1px dotted; | |
outline: 3px auto -webkit-focus-ring-color; | |
} | |
.btn:hover, | |
.btn:focus, | |
.btn:active { | |
text-decoration: none; | |
} | |
.btn:disabled, | |
.btn.is-disabled { | |
cursor: not-allowed; | |
pointer-events: none; | |
opacity: .65; | |
} | |
/** | |
* button Modifier: Size | |
* -------------------------------------------------- | |
*/ | |
.btn-small { | |
font-size: 12px; | |
line-height: 18px; | |
min-height: 28px; | |
padding: 4px 8px; | |
border-radius: 2px; | |
} | |
.btn-large { | |
font-size: 16px; | |
line-height: 22px; | |
min-height: 40px; | |
padding: 8px 16px; | |
border-radius: 4px; | |
} | |
/** | |
* button Modifier: Variations | |
* -------------------------------------------------- | |
*/ | |
.btn-primary { | |
color: #fff; | |
border-color: #967adc; | |
background-color: #ac92ec; | |
} | |
.btn-primary:hover { | |
color: #fff; | |
border-color: #967adc; | |
background-color: #967adc; | |
} | |
.btn-secondary { | |
color: #fff; | |
border-color: #4a89dc; | |
background-color: #5d9cec; | |
} | |
.btn-secondary:hover { | |
color: #fff; | |
border-color: #4a89dc; | |
background-color: #4a89dc; | |
} | |
.btn-outline { | |
color: #434a54; | |
border-color: #434a54; | |
background-color: transparent; | |
} | |
.btn-outline:hover { | |
color: #fff; | |
border-color: #434a54; | |
background-color: #434a54; | |
} | |
.btn-link { | |
color: #5d9cec; | |
border-color: transparent; | |
background-color: transparent; | |
} | |
.btn-link:hover { | |
color: #4a89dc; | |
border-color: transparent; | |
background-color: transparent; | |
} | |
.btn-success { | |
color: #fff; | |
border-color: #8cc152; | |
background-color: #a0d468; | |
} | |
.btn-success:hover { | |
color: #fff; | |
border-color: #8cc152; | |
background-color: #8cc152; | |
} | |
.btn-info { | |
color: #fff; | |
border-color: #3bafda; | |
background-color: #4fc1e9; | |
} | |
.btn-info:hover { | |
color: #fff; | |
border-color: #3bafda; | |
background-color: #3bafda; | |
} | |
.btn-warning { | |
color: #fff; | |
border-color: #f6bb42; | |
background-color: #ffce54; | |
} | |
.btn-warning:hover { | |
color: #fff; | |
border-color: #f6bb42; | |
background-color: #f6bb42; | |
} | |
.btn-error { | |
color: #fff; | |
border-color: #da4453; | |
background-color: #ed5565; | |
} | |
.btn-error:hover { | |
color: #fff; | |
border-color: #da4453; | |
background-color: #da4453; | |
} | |
/** | |
* button Group: Vertical and Horizontal | |
* -------------------------------------------------- | |
*/ | |
.btn-group { | |
font-size: 0; | |
display: inline-block; | |
margin: 0; | |
padding: 0; | |
list-style: none; | |
} | |
.btn-group + .btn-group { | |
margin-left: 30px; | |
} | |
.btn-group-item:not(:first-child):not(:last-child) > .btn { | |
border-radius: 0 !important; | |
} | |
.btn-group-item > .btn { | |
display: block; | |
width: 100%; | |
} | |
.btn-group-item > .btn:hover, | |
.btn-group-item > .btn:focus, | |
.btn-group-item > .btn:active { | |
z-index: 1; | |
} | |
.btn-group--horizontal > .btn-group-item { | |
display: inline-block; | |
margin-left: -1px; | |
} | |
.btn-group--horizontal > .btn-group-item:first-child:not(:only-child) { | |
margin-left: 0; | |
} | |
.btn-group--horizontal > .btn-group-item:first-child:not(:only-child) > .btn { | |
border-top-right-radius: 0 !important; | |
border-bottom-right-radius: 0 !important; | |
} | |
.btn-group--horizontal > .btn-group-item:last-child:not(:only-child) > .btn { | |
border-top-left-radius: 0 !important; | |
border-bottom-left-radius: 0 !important; | |
} | |
.btn-group--vertical > .btn-group-item { | |
display: block; | |
margin-top: -1px; | |
} | |
.btn-group--vertical > .btn-group-item:first-child:not(:only-child) { | |
margin-top: 0; | |
} | |
.btn-group--vertical > .btn-group-item:first-child:not(:only-child) > .btn { | |
border-bottom-right-radius: 0 !important; | |
border-bottom-left-radius: 0 !important; | |
} | |
.btn-group--vertical > .btn-group-item:last-child:not(:only-child) > .btn { | |
border-top-left-radius: 0 !important; | |
border-top-right-radius: 0 !important; | |
} | |
.btn-group--vertical > .btn-group-item > .btn { | |
text-align: left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`
/* Horizontal List */
ul.horizontal-list {
list-style: none;
padding-top: 20px;
}
ul.horizontal-list li {
display: inline;
}
`