You've already forked wc-bootstrap
Phase 6 - My Account (15 templates): - Account layout with sidebar navigation (list-group) and content area - Orders table with status badges, pagination, and responsive design - View order with order notes as list-group items - Address cards with edit/add buttons - Login/Register side-by-side card layout - Account edit, password change, downloads, payment methods forms - Lost/reset password forms and confirmation Phase 7 - Order Details (5 templates): - Order details table with items, totals, and customer note - Line item rows with refund quantity display - Customer billing/shipping address cards - Order tracking form - Order again button All order templates use WC_Order object methods only (HPOS compatible). Bootstrap 5 components: cards, tables, list-groups, badges, forms, alerts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
348 lines
10 KiB
CSS
348 lines
10 KiB
CSS
/**
|
|
* WooCommerce Bootstrap - Bootstrap 5 Overrides
|
|
*
|
|
* Provides Bootstrap 5 styling for any plugin CSS classes
|
|
* that may be injected by the plugin's JavaScript or inline markup.
|
|
*
|
|
* CSS dependency chain (lowest to highest priority):
|
|
* 1. wp-bootstrap (parent theme)
|
|
* 2. woocommerce (plugin styles)
|
|
* 3. wc-bootstrap-style (child theme style.css)
|
|
* 4. wc-bootstrap-overrides (this file)
|
|
*
|
|
* @package WcBootstrap
|
|
* @since 0.1.0
|
|
*/
|
|
|
|
/* ==========================================================================
|
|
Button Overrides
|
|
Map plugin button classes to Bootstrap button styles.
|
|
========================================================================== */
|
|
|
|
/* Example: Map plugin .my-button to Bootstrap styling
|
|
.my-button {
|
|
display: inline-block;
|
|
font-weight: 400;
|
|
line-height: 1.5;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
vertical-align: middle;
|
|
cursor: pointer;
|
|
border: 1px solid transparent;
|
|
padding: 0.375rem 0.75rem;
|
|
font-size: 1rem;
|
|
border-radius: var(--bs-border-radius);
|
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
|
|
}
|
|
*/
|
|
|
|
/* ==========================================================================
|
|
WooCommerce Notice Overrides
|
|
Map WooCommerce notice classes to Bootstrap alert styles as fallback
|
|
when notices are rendered outside our Twig templates.
|
|
========================================================================== */
|
|
|
|
.woocommerce-info,
|
|
.woocommerce-message,
|
|
.woocommerce-error {
|
|
position: relative;
|
|
padding: 1rem 3rem 1rem 1rem;
|
|
margin-bottom: 1rem;
|
|
border: 1px solid transparent;
|
|
border-radius: var(--bs-border-radius);
|
|
}
|
|
|
|
.woocommerce-info {
|
|
color: var(--bs-info-text-emphasis);
|
|
background-color: var(--bs-info-bg-subtle);
|
|
border-color: var(--bs-info-border-subtle);
|
|
}
|
|
|
|
.woocommerce-message {
|
|
color: var(--bs-success-text-emphasis);
|
|
background-color: var(--bs-success-bg-subtle);
|
|
border-color: var(--bs-success-border-subtle);
|
|
}
|
|
|
|
.woocommerce-error {
|
|
color: var(--bs-danger-text-emphasis);
|
|
background-color: var(--bs-danger-bg-subtle);
|
|
border-color: var(--bs-danger-border-subtle);
|
|
list-style: none;
|
|
padding-left: 1rem;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Quantity Input
|
|
Sizing for the Bootstrap input-group quantity widget.
|
|
========================================================================== */
|
|
|
|
.quantity.input-group .form-control {
|
|
/* Remove number input spinners (browser default) */
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
.quantity.input-group .form-control::-webkit-outer-spin-button,
|
|
.quantity.input-group .form-control::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Product Cards
|
|
Hover effects and layout for product loop cards.
|
|
========================================================================== */
|
|
|
|
.product.card {
|
|
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
}
|
|
|
|
.product.card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--bs-box-shadow) !important;
|
|
}
|
|
|
|
/* Product image in card */
|
|
.product.card img {
|
|
object-fit: cover;
|
|
aspect-ratio: 1 / 1;
|
|
width: 100%;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Sale Badge
|
|
Positioning for the sale overlay badge on product cards.
|
|
========================================================================== */
|
|
|
|
.onsale {
|
|
z-index: 1;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Star Rating
|
|
Consistent sizing for Bootstrap Icon star ratings.
|
|
========================================================================== */
|
|
|
|
.wc-star-rating .bi {
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Price Styling
|
|
Override WooCommerce default price markup with Bootstrap-aligned styles.
|
|
========================================================================== */
|
|
|
|
.price del {
|
|
text-decoration: line-through;
|
|
color: var(--bs-secondary-color);
|
|
font-weight: 400;
|
|
}
|
|
|
|
.price ins {
|
|
text-decoration: none;
|
|
color: var(--bs-danger);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Product Gallery
|
|
Thumbnail grid and cursor for single product image gallery.
|
|
========================================================================== */
|
|
|
|
.wc-gallery-thumb {
|
|
cursor: pointer;
|
|
opacity: 0.7;
|
|
transition: opacity 0.15s ease;
|
|
}
|
|
|
|
.wc-gallery-thumb:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.woocommerce-product-gallery__image img {
|
|
width: 100%;
|
|
height: auto;
|
|
border-radius: var(--bs-border-radius);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Variation Selectors
|
|
Spacing for variable product attribute dropdowns.
|
|
========================================================================== */
|
|
|
|
.variations_form .reset_variations {
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.single_variation_wrap .woocommerce-variation {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
WooCommerce Grid Override
|
|
Reset WooCommerce's default grid to let Bootstrap handle layout.
|
|
========================================================================== */
|
|
|
|
.woocommerce ul.products {
|
|
display: contents;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Cart Table
|
|
Responsive cart item layout and thumbnail sizing.
|
|
========================================================================== */
|
|
|
|
.woocommerce-cart-form .product-thumbnail img {
|
|
width: 60px;
|
|
height: 60px;
|
|
object-fit: cover;
|
|
border-radius: var(--bs-border-radius);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Checkout
|
|
Sticky order review sidebar and payment method toggle.
|
|
========================================================================== */
|
|
|
|
.payment_box {
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.woocommerce-checkout .form-row label {
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* Override WooCommerce form fields to use Bootstrap styles */
|
|
.woocommerce-checkout .form-row input.input-text,
|
|
.woocommerce-checkout .form-row textarea,
|
|
.woocommerce-checkout .form-row select {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 0.375rem 0.75rem;
|
|
font-size: 1rem;
|
|
font-weight: 400;
|
|
line-height: 1.5;
|
|
color: var(--bs-body-color);
|
|
background-color: var(--bs-body-bg);
|
|
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
border-radius: var(--bs-border-radius);
|
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
}
|
|
|
|
.woocommerce-checkout .form-row input.input-text:focus,
|
|
.woocommerce-checkout .form-row textarea:focus,
|
|
.woocommerce-checkout .form-row select:focus {
|
|
border-color: #86b7fe;
|
|
outline: 0;
|
|
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Dark Mode Overrides
|
|
Fix any plugin elements that don't adapt to Bootstrap's dark mode.
|
|
========================================================================== */
|
|
|
|
/* Bootstrap 5 dark mode uses data-bs-theme="dark" attribute on <html> */
|
|
[data-bs-theme="dark"] {
|
|
/* Checkout form focus color for dark mode */
|
|
}
|
|
|
|
[data-bs-theme="dark"] .woocommerce-checkout .form-row input.input-text:focus,
|
|
[data-bs-theme="dark"] .woocommerce-checkout .form-row textarea:focus,
|
|
[data-bs-theme="dark"] .woocommerce-checkout .form-row select:focus {
|
|
border-color: #6ea8fe;
|
|
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Sticky Header
|
|
Shadow effect when header is in stuck position.
|
|
========================================================================== */
|
|
|
|
header.sticky-top.is-stuck {
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
transition: box-shadow 0.2s ease;
|
|
}
|
|
|
|
[data-bs-theme="dark"] header.sticky-top.is-stuck {
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Block Navigation Fix
|
|
Required for dropdown menus inside WordPress block navigation.
|
|
========================================================================== */
|
|
|
|
.wp-block-navigation__container {
|
|
overflow: visible !important;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
My Account
|
|
Navigation and layout for the My Account area.
|
|
========================================================================== */
|
|
|
|
.woocommerce-MyAccount-navigation .list-group-item.active {
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Order status marks */
|
|
.woocommerce-order-details mark {
|
|
background: none;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* View-order notes */
|
|
.woocommerce-OrderUpdate-description p:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
/* Address cards */
|
|
.woocommerce-Address address {
|
|
font-style: normal;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
/* My Account forms — apply Bootstrap form-control styles */
|
|
.woocommerce-MyAccount-content .form-row input.input-text,
|
|
.woocommerce-MyAccount-content .form-row textarea,
|
|
.woocommerce-MyAccount-content .form-row select {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 0.375rem 0.75rem;
|
|
font-size: 1rem;
|
|
font-weight: 400;
|
|
line-height: 1.5;
|
|
color: var(--bs-body-color);
|
|
background-color: var(--bs-body-bg);
|
|
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
border-radius: var(--bs-border-radius);
|
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
}
|
|
|
|
.woocommerce-MyAccount-content .form-row input.input-text:focus,
|
|
.woocommerce-MyAccount-content .form-row textarea:focus,
|
|
.woocommerce-MyAccount-content .form-row select:focus {
|
|
border-color: #86b7fe;
|
|
outline: 0;
|
|
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Order Details
|
|
Styling for the order details and tracking pages.
|
|
========================================================================== */
|
|
|
|
.woocommerce-order-details .table tfoot th {
|
|
font-weight: 500;
|
|
}
|
|
|
|
.woocommerce-order-details .table tfoot tr:last-child th,
|
|
.woocommerce-order-details .table tfoot tr:last-child td {
|
|
font-weight: 700;
|
|
}
|
|
|
|
.product-quantity {
|
|
white-space: nowrap;
|
|
}
|