button.css 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. button {
  2. /* Style reset */
  3. padding: 0;
  4. border: none;
  5. font: inherit;
  6. color: inherit;
  7. background-color: transparent;
  8. }
  9. .button {
  10. cursor: pointer;
  11. /* default for <button>, but useful for <a> */
  12. display: inline-block;
  13. text-align: center;
  14. text-decoration: none;
  15. /* create a small space when buttons wrap on 2 lines */
  16. margin: 2px 0;
  17. /* invisible border (will be colored on hover/focus) */
  18. border: solid 1px transparent;
  19. border-radius: 4px;
  20. /* size comes from text & padding (no width/height) */
  21. padding: 0.5em 1em;
  22. /* make sure colors have enough contrast! */
  23. color: #000;
  24. background-color: var(--color-primary);
  25. }
  26. .button:active {
  27. transform: translateY(1px);
  28. filter: saturate(150%);
  29. }
  30. .button:hover,
  31. .button:focus {
  32. border-color: currentColor;
  33. background-color: var(--color-primary-saturated);
  34. }
  35. .button--inline {
  36. }
  37. .button--secondary {
  38. background-color: var(--color-secondary);
  39. color: white;
  40. }
  41. .button--secondary:hover,
  42. .button--secondary:focus {
  43. border-color: currentColor;
  44. background-color: var(--color-secondary-saturated);
  45. }
  46. .button--success {
  47. background-color: var(--color-success);
  48. color: white;
  49. }
  50. .button--success:hover,
  51. .button--success:focus {
  52. border-color: currentColor;
  53. background-color: var(--color-success-saturated);
  54. }
  55. .button--warning {
  56. background-color: var(--color-warning);
  57. color: #000;
  58. }
  59. .button--warning:hover,
  60. .button--warning:focus {
  61. border-color: currentColor;
  62. background-color: var(--color-warning-saturated);
  63. }
  64. .button--danger {
  65. background-color: var(--color-danger);
  66. color: white;
  67. }
  68. .button--danger:hover,
  69. .button--danger:focus {
  70. border-color: currentColor;
  71. background-color: var(--color-danger-saturated);
  72. }