Feat: Add themeable payment option icons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f3812b588
commit
df82588768
2 files changed
+24
-1
No files matched your search
@@ -70,6 +70,13 @@
|
|||||||
--bbk-icon-shipping: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 9h4l3 3v4h-7z'/%3E%3Ccircle cx='7' cy='17.5' r='1.75'/%3E%3Ccircle cx='17' cy='17.5' r='1.75'/%3E%3C/svg%3E");
|
--bbk-icon-shipping: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 9h4l3 3v4h-7z'/%3E%3Ccircle cx='7' cy='17.5' r='1.75'/%3E%3Ccircle cx='17' cy='17.5' r='1.75'/%3E%3C/svg%3E");
|
||||||
--bbk-icon-billing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14v18l-2.33-1.5L14.33 21 12 19.5 9.67 21l-2.34-1.5L5 21z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E");
|
--bbk-icon-billing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14v18l-2.33-1.5L14.33 21 12 19.5 9.67 21l-2.34-1.5L5 21z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E");
|
||||||
--bbk-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h3.5l1.5 4.5-2.25 1.5a11 11 0 0 0 7.25 7.25L16.5 14l4.5 1.5V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
|
--bbk-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h3.5l1.5 4.5-2.25 1.5a11 11 0 0 0 7.25 7.25L16.5 14l4.5 1.5V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
|
||||||
|
|
||||||
|
/* Payment options, keyed by payment driver; --bbk-icon-payment is the
|
||||||
|
fallback for any driver without its own icon. */
|
||||||
|
--bbk-icon-payment: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M17 14h.01'/%3E%3C/svg%3E");
|
||||||
|
--bbk-icon-payment-stripe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='2'/%3E%3Cpath d='M2.5 10h19'/%3E%3C/svg%3E");
|
||||||
|
--bbk-icon-payment-cash-on-delivery: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E");
|
||||||
|
--bbk-icon-payment-bank-transfer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5 12 4l9 5.5M4 20h16M5 10v7M9.67 10v7M14.33 10v7M19 10v7'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.bbk-cart[hidden] { display: none; }
|
.bbk-cart[hidden] { display: none; }
|
||||||
@@ -188,6 +195,11 @@
|
|||||||
.bbk-icon--shipping { --bbk-icon: var(--bbk-icon-shipping); }
|
.bbk-icon--shipping { --bbk-icon: var(--bbk-icon-shipping); }
|
||||||
.bbk-icon--billing { --bbk-icon: var(--bbk-icon-billing); }
|
.bbk-icon--billing { --bbk-icon: var(--bbk-icon-billing); }
|
||||||
.bbk-icon--phone { --bbk-icon: var(--bbk-icon-phone); }
|
.bbk-icon--phone { --bbk-icon: var(--bbk-icon-phone); }
|
||||||
|
/* Generic first, so a driver-specific class below wins when both apply. */
|
||||||
|
.bbk-icon--payment { --bbk-icon: var(--bbk-icon-payment); }
|
||||||
|
.bbk-icon--payment-stripe { --bbk-icon: var(--bbk-icon-payment-stripe); }
|
||||||
|
.bbk-icon--payment-cash-on-delivery { --bbk-icon: var(--bbk-icon-payment-cash-on-delivery); }
|
||||||
|
.bbk-icon--payment-bank-transfer { --bbk-icon: var(--bbk-icon-payment-bank-transfer); }
|
||||||
|
|
||||||
.bbk-visually-hidden {
|
.bbk-visually-hidden {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -911,7 +923,15 @@ textarea.bbk-field-input { resize: vertical; }
|
|||||||
|
|
||||||
.bbk-checkout-payment-option:has(input:checked) { border-color: var(--bbk-color-accent); }
|
.bbk-checkout-payment-option:has(input:checked) { border-color: var(--bbk-color-accent); }
|
||||||
|
|
||||||
.bbk-checkout-payment-option-name { font-weight: 600; }
|
.bbk-checkout-payment-option-name { flex: 1 1 auto; font-weight: 600; }
|
||||||
|
|
||||||
|
.bbk-checkout-payment-option-icon {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
color: var(--bbk-color-muted);
|
||||||
|
transition: color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bbk-checkout-payment-option:has(input:checked) .bbk-checkout-payment-option-icon { color: var(--bbk-color-text); }
|
||||||
|
|
||||||
.bbk-payment-element { margin: 0.25rem 0; }
|
.bbk-payment-element { margin: 0.25rem 0; }
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
data-action="change->bbk-payment#selectMethod"
|
data-action="change->bbk-payment#selectMethod"
|
||||||
>
|
>
|
||||||
<span class="bbk-checkout-payment-option-name">{{ $method->translate('name') }}</span>
|
<span class="bbk-checkout-payment-option-name">{{ $method->translate('name') }}</span>
|
||||||
|
{{-- Picked by driver (--bbk-icon-payment-{driver}); unknown
|
||||||
|
drivers fall back to the generic --bbk-icon-payment. --}}
|
||||||
|
<span class="bbk-icon bbk-icon--payment bbk-icon--payment-{{ $method->driver }} bbk-checkout-payment-option-icon" aria-hidden="true"></span>
|
||||||
</label>
|
</label>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user