_buttons.scss 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. outline: none;
  39. } // end hover
  40. // clicking on the button
  41. &:active {
  42. top: 1px; // adds a tiny hop to the click
  43. } // end active
  44. } // end .button
  45. /*
  46. An example button.
  47. You can use this example if you want. Just replace all the variables
  48. and it will create a button dependant on those variables.
  49. */
  50. .blue-btn {
  51. @extend %btn; // here we load the btn defaults
  52. background-color: $blue;
  53. &:hover,
  54. &:focus {
  55. background-color: darken($blue, 4%);
  56. } // end hover
  57. &:active {
  58. background-color: darken($blue, 5%);
  59. } // end active
  60. } // end blue button