|
| 1 | +.button { |
| 2 | + display: inline-flex; |
| 3 | + align-items: center; |
| 4 | + justify-content: center; |
| 5 | + gap: 8px; |
| 6 | + border: 1px solid transparent; |
| 7 | + border-radius: 5px; |
| 8 | + font-size: 16px; |
| 9 | + font-family: sans-serif; |
| 10 | + font-weight: 500; |
| 11 | + cursor: pointer; |
| 12 | + transition: all 0.2s ease; |
| 13 | + outline: none; |
| 14 | + text-decoration: none; |
| 15 | + box-sizing: border-box; |
| 16 | + user-select: none; |
| 17 | + position: relative; |
| 18 | +} |
| 19 | + |
| 20 | +.button:focus { |
| 21 | + outline: none; |
| 22 | + box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); |
| 23 | +} |
| 24 | + |
| 25 | +.button:disabled { |
| 26 | + cursor: not-allowed; |
| 27 | + opacity: 0.6; |
| 28 | +} |
| 29 | + |
| 30 | +/* Variants */ |
| 31 | +.primary { |
| 32 | + background-color: #007bff; |
| 33 | + color: white; |
| 34 | + border-color: #007bff; |
| 35 | +} |
| 36 | + |
| 37 | +.primary:hover:not(:disabled) { |
| 38 | + background-color: #0056b3; |
| 39 | + border-color: #0056b3; |
| 40 | +} |
| 41 | + |
| 42 | +.primary:active:not(:disabled) { |
| 43 | + background-color: #004085; |
| 44 | + border-color: #004085; |
| 45 | +} |
| 46 | + |
| 47 | +.secondary { |
| 48 | + background-color: #f5f5f5; |
| 49 | + color: #333; |
| 50 | + border-color: #ccc; |
| 51 | +} |
| 52 | + |
| 53 | +.secondary:hover:not(:disabled) { |
| 54 | + background-color: #e9ecef; |
| 55 | + border-color: #adb5bd; |
| 56 | +} |
| 57 | + |
| 58 | +.secondary:active:not(:disabled) { |
| 59 | + background-color: #dee2e6; |
| 60 | + border-color: #adb5bd; |
| 61 | +} |
| 62 | + |
| 63 | +.danger { |
| 64 | + background-color: #ff4d4f; |
| 65 | + color: white; |
| 66 | + border-color: #ff4d4f; |
| 67 | +} |
| 68 | + |
| 69 | +.danger:hover:not(:disabled) { |
| 70 | + background-color: #d9363e; |
| 71 | + border-color: #d9363e; |
| 72 | +} |
| 73 | + |
| 74 | +.danger:active:not(:disabled) { |
| 75 | + background-color: #c82333; |
| 76 | + border-color: #c82333; |
| 77 | +} |
| 78 | + |
| 79 | +.ghost { |
| 80 | + background-color: transparent; |
| 81 | + color: #007bff; |
| 82 | + border-color: transparent; |
| 83 | +} |
| 84 | + |
| 85 | +.ghost:hover:not(:disabled) { |
| 86 | + background-color: rgba(0, 123, 255, 0.1); |
| 87 | + border-color: transparent; |
| 88 | +} |
| 89 | + |
| 90 | +.ghost:active:not(:disabled) { |
| 91 | + background-color: rgba(0, 123, 255, 0.2); |
| 92 | + border-color: transparent; |
| 93 | +} |
| 94 | + |
| 95 | +/* Sizes */ |
| 96 | +.small { |
| 97 | + padding: 6px 12px; |
| 98 | + font-size: 14px; |
| 99 | + min-height: 32px; |
| 100 | +} |
| 101 | + |
| 102 | +.medium { |
| 103 | + padding: 10px 16px; |
| 104 | + font-size: 16px; |
| 105 | + min-height: 40px; |
| 106 | +} |
| 107 | + |
| 108 | +.large { |
| 109 | + padding: 12px 20px; |
| 110 | + font-size: 18px; |
| 111 | + min-height: 48px; |
| 112 | +} |
| 113 | + |
| 114 | +/* Loading spinner */ |
| 115 | +.spinner { |
| 116 | + width: 16px; |
| 117 | + height: 16px; |
| 118 | + border: 2px solid transparent; |
| 119 | + border-top: 2px solid currentColor; |
| 120 | + border-radius: 50%; |
| 121 | + animation: spin 1s linear infinite; |
| 122 | +} |
| 123 | + |
| 124 | +@keyframes spin { |
| 125 | + 0% { |
| 126 | + transform: rotate(0deg); |
| 127 | + } |
| 128 | + 100% { |
| 129 | + transform: rotate(360deg); |
| 130 | + } |
| 131 | +} |
| 132 | + |
| 133 | +/* Responsive design */ |
| 134 | +@media (max-width: 768px) { |
| 135 | + .button { |
| 136 | + font-size: 16px; /* Prevents zoom on iOS */ |
| 137 | + } |
| 138 | + |
| 139 | + .small { |
| 140 | + padding: 8px 14px; |
| 141 | + font-size: 14px; |
| 142 | + } |
| 143 | + |
| 144 | + .medium { |
| 145 | + padding: 12px 18px; |
| 146 | + font-size: 16px; |
| 147 | + } |
| 148 | + |
| 149 | + .large { |
| 150 | + padding: 14px 22px; |
| 151 | + font-size: 18px; |
| 152 | + } |
| 153 | +} |
0 commit comments