_buttons.scss 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /******************************************************************
  2. Site Name:
  3. Author:
  4. Stylesheet: Button Styles
  5. Buttons are a pretty important part of your site's style, so it's
  6. important to have a consistent baseline for them. Use this stylesheet
  7. to create all kinds of buttons.
  8. Helpful Links:
  9. http://galp.in/blog/2011/08/02/the-ui-guide-part-1-buttons/
  10. ******************************************************************/
  11. /*********************
  12. BUTTON DEFAULTS
  13. We're gonna use a placeholder selector here
  14. so we can use common styles. We then use this
  15. to load up the defaults in all our buttons.
  16. Here's a quick video to show how it works:
  17. http://www.youtube.com/watch?v=hwdVpKiJzac
  18. *********************/
  19. %btn {
  20. display: inline-block;
  21. position: relative;
  22. font-family: $sans-serif;
  23. text-decoration: none;
  24. color: $white;
  25. font-size: 0.9em;
  26. font-size: 34px;
  27. line-height: 34px;
  28. font-weight: normal;
  29. padding: 0 24px;
  30. border-radius: 4px;
  31. border: 0;
  32. cursor: pointer;
  33. @include transition(background-color 0.14s ease-in-out);
  34. // hovering on the btn
  35. &:hover, &:focus {
  36. color: $white;
  37. text-decoration: none;
  38. } // end hover
  39. // clicking on the button
  40. &:active {
  41. top: 1px; // adds a tiny hop to the click
  42. } // end active
  43. } // end .button
  44. /*
  45. An example button.
  46. You can use this example if you want. Just replace all the variables
  47. and it will create a button dependant on those variables.
  48. */
  49. .blue-btn {
  50. @extend %btn; // here we load the btn defaults
  51. background-color: $blue;
  52. &:hover,
  53. &:focus {
  54. background-color: darken($blue, 4%);
  55. } // end hover
  56. &:active {
  57. background-color: darken($blue, 5%);
  58. } // end active
  59. } // end blue button