woocommerce/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/style.scss

74 lines
1.5 KiB
SCSS
Raw Normal View History

.wc-block-checkout__form {
margin: 0;
max-width: 100%;
}
.is-mobile,
.is-small,
.is-medium {
.wc-block-checkout__main {
order: 1;
}
}
.is-small,
.is-medium,
.is-large {
.wc-block-checkout__shipping-fields,
.wc-block-checkout__billing-fields {
.wc-block-components-address-form {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 0 calc(#{$gap-smaller} * 2); // Required for spacing especially when using flex-grow
.wc-block-components-text-input,
.wc-block-components-state-input,
.wc-block-components-select-input {
flex: 1 0 calc(50% - #{$gap-small}); // "flex-grow = 1" allows the input to grow to fill the space
box-sizing: border-box;
&:first-child {
margin-top: 0;
}
&:first-child + .wc-block-components-text-input {
margin-top: 0;
}
}
.wc-block-components-address-form__company,
.wc-block-components-address-form__address_1,
.wc-block-components-address-form__address_2,
Add Checkbox support for Additional Fields in Checkout Block (#42780) * Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073 * revert test to what it was * Default to text, if the type supplied is not supported throw an error * Add type for options * Return null if somehow the select made it through without options * Make select fields type enum and add options to schema * Lint fixes * Update plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/address-form.tsx Co-authored-by: Niels Lange <info@nielslange.de> * Update plugins/woocommerce/src/Blocks/Domain/Services/CheckoutFields.php Co-authored-by: Niels Lange <info@nielslange.de> * Update checks to log errors and fail gracefully * Add field id to class names * Fix lint error * Fix short array use * Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073 * Default to text, if the type supplied is not supported throw an error * Lint fixes * Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073 * add support for registering checkboxes * remove extra error log * add styling * fix rebase conflit * fix rebase conflit 2 * fix linter errors * address review comments * add warning for checkbox * fix changes --------- Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com> Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-18 12:21:36 +00:00
.wc-block-components-country-input,
.wc-block-components-checkbox {
flex: 0 0 100%;
&:first-child {
margin-top: 0;
}
}
}
}
.wc-block-components-address-form {
.wc-block-components-checkbox {
margin-top: $gap;
}
.wc-block-components-text-input.wc-block-components-address-form__email {
&:only-child {
margin-top: 0;
}
}
}
}
Block-based checkout - Update address fields display logic (#47160) * Add “Address line 2” toggle * Allow apartment field to be required * Add changefile(s) from automation for the following project(s): woocommerce-blocks * Rename “Apartment, suite, etc.” to “Address line 2” * Remove unused dependency * Add key to fragment * Simplify keys * Address failing e2e tests * Change “Optional (Recommended)” to “Optional” * Toggle address line 2 visibility in editor * Add e2e tests * Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce * Update e2e tests * Update e2e tests * Ensure the address 2 field stays open when the seller empties it * Optimise hasAddress2FieldValue * Move address 2 filed related functionality into separate component * Rmove + sign from address 2 field links * WIP: Introduce AddressField component * Update AddressFields component * Refactor AddressFields and Address2Field components * Fix CSS lint error * Fix JS lint error * Fix failing e2e tests * Fix typo in e2e tests * Improve e2e selector * Fix core e2e tests * Use address line 2 label for the link text * Lazy initialise the “isFieldVisible” state * Remove obsolete code * Add inline comments for clarity * Fix JS lint error * Improve e2e tests * Revert "Remove obsolete code" This reverts commit 027d6adc896e153b68d306b49e0fb793752cb8a0. * Adjust visibility toggle * Delete obsolete changelog file * Add inline comment * Fix TS error * Remove obsolete parts * Solve TS warning * Remove obsolete “fieldsRef” * Remove obsolete “setHasFieldBeenModified” * Address various TS warnings * Fix link styling issue on mobile * Fix JS lint error * Refactor and simplify address components * Optimise Address2Field component * Improve inline docs * Move ‘+’ from CSS to i18n * Rename rest of values and pass correct onChange * force component to remount * remove unsed useEffect --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-05-21 08:48:24 +00:00
.wc-block-components-address-form__address_2-toggle {
background: none;
border: none;
cursor: pointer;
color: currentColor;
Block-based checkout - Update address fields display logic (#47160) * Add “Address line 2” toggle * Allow apartment field to be required * Add changefile(s) from automation for the following project(s): woocommerce-blocks * Rename “Apartment, suite, etc.” to “Address line 2” * Remove unused dependency * Add key to fragment * Simplify keys * Address failing e2e tests * Change “Optional (Recommended)” to “Optional” * Toggle address line 2 visibility in editor * Add e2e tests * Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce * Update e2e tests * Update e2e tests * Ensure the address 2 field stays open when the seller empties it * Optimise hasAddress2FieldValue * Move address 2 filed related functionality into separate component * Rmove + sign from address 2 field links * WIP: Introduce AddressField component * Update AddressFields component * Refactor AddressFields and Address2Field components * Fix CSS lint error * Fix JS lint error * Fix failing e2e tests * Fix typo in e2e tests * Improve e2e selector * Fix core e2e tests * Use address line 2 label for the link text * Lazy initialise the “isFieldVisible” state * Remove obsolete code * Add inline comments for clarity * Fix JS lint error * Improve e2e tests * Revert "Remove obsolete code" This reverts commit 027d6adc896e153b68d306b49e0fb793752cb8a0. * Adjust visibility toggle * Delete obsolete changelog file * Add inline comment * Fix TS error * Remove obsolete parts * Solve TS warning * Remove obsolete “fieldsRef” * Remove obsolete “setHasFieldBeenModified” * Address various TS warnings * Fix link styling issue on mobile * Fix JS lint error * Refactor and simplify address components * Optimise Address2Field component * Improve inline docs * Move ‘+’ from CSS to i18n * Rename rest of values and pass correct onChange * force component to remount * remove unsed useEffect --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-05-21 08:48:24 +00:00
font-size: inherit;
margin-top: $gap;
text-align: left;
width: 100%;
}