woocommerce/plugins/woocommerce-blocks/packages/components/form-step/style.scss

175 lines
4.3 KiB
SCSS
Raw Normal View History

.wc-block-components-form {
counter-reset: checkout-step;
}
.wc-block-components-form .wc-block-components-checkout-step {
position: relative;
border: none;
padding: 0;
background: none;
margin: 0 0 $gap-largest 0;
.is-mobile &,
.is-small & {
padding-left: 0;
margin-bottom: $gap-larger;
// The below CSS rules are to show a separator between Checkout steps on mobile.
// This media query is required because on themes where the Checkout block is rendered alongside something else,
// e.g. Storefront using the "Default Template" (which has a sidebar) the checkout block can get the `.is-small`
// class, but the screen itself is larger than 400px.
@include breakpoint( "<600px" ) {
padding-top: $gap-larger;
// Remove padding from the first checkout step. First of type is required here as the first-child is the express payment methods block.
&:first-of-type {
padding-top: 0;
}
&::after {
position: absolute;
content: "";
// Required because the box shadows are offset by 1px down so we need to move the element up by 1px.
bottom: calc(1px - $gap-larger);
width: 100%;
height: 1px;
opacity: 0.11;
background: currentColor;
// This box-shadow rule creates two visible shadows:
// - One 50vw to the left of the element.
// - Another 50vw to the right
// Both shadows are sharp (no blur) and use the current color of the element.
// Its purpose is to add a full-width divider between checkout sections which is otherwise impossible as
// the parent element has padding.
box-shadow: -50vw 0 0 0 currentColor, 50vw 0 0 0 currentColor;
}
}
}
}
.wc-block-components-checkout-step--disabled {
opacity: 0.6;
}
.wc-block-components-checkout-step__container {
position: relative;
Add theme-level global styles to Cart and Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/8809) * Dummy commit to open a PR * Revert the last change * Ensure Checkout block supports the theme-level global styles for `Colors » Buttons` (https://github.com/woocommerce/woocommerce-blocks/pull/8844) * Add GS support for button colors in Checkout block * Sync button hover effect with GB * Fix link margin/padding (https://github.com/woocommerce/woocommerce-blocks/pull/8908) * Replace <AddToCartButton /> with <ProductButton /> (https://github.com/woocommerce/woocommerce-blocks/pull/8914) * Add GS support for button typography in Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/8918) * Ensure Checkout block supports the theme-level global styles for Typography » Buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8892) * Remove classname from cart image to avoid conflicts (https://github.com/woocommerce/woocommerce-blocks/pull/8898) Co-authored-by: Niels Lange <info@nielslange.de> * Use consistent and semantically correct HTML elements in the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9065) * Allow button height to adjust * Ensure to display full width heading background * Inherit font style and font weight for headings * Inherit font style and font weight for textarea * Inherit font family and font weight for buttons --------- Co-authored-by: Niels Lange <info@nielslange.de> Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-04-21 20:11:10 +00:00
textarea {
font-style: inherit;
font-weight: inherit;
}
}
WIP - Checkout i2 Feature Branch Tracking (https://github.com/woocommerce/woocommerce-blocks/pull/4268) * Duplicate checkout block * Contact information block * form step block * shipping address block * Setup atomic blocks * Container structure * More formal steps rather than generic form step * Add billing and shipping forms * add checkout actions block * add order note block * Add order summary * add payment block * Add inspector controls for address fields * frontend WIP * move attributes * wrap shipping with form step * PhoneNumber to typescript * Remove column block * form steps * move payment logic to frontend * Express block * inline payment block * Add shipping method block * Render inner blocks (not standalone blocks) and add classes to Atomic Block list on php side * lazy again * Add more wrappers from old frontend file * add layout * Checkout wrappers were missing * Enqueue payment methods for new block * Add missing classnames * Move shipping as billing state to context provider * express payments rendering * try/block-registry * Remove atomic components (unused) * Fix attribute persistance due to template locking * Fix shipping display when not needed * Set correct parent blocks for inner blocks * pass data to blocks * demo/newsletter * Skeleton styling * only apply styles to loading state for now * shipping method block frontend * rename express block * lock template * fix ts warning for __webpack_public_path__ * Refactor to avoid duplicating atomic block logic * remove changes in save method * Add zones and shipping methods to the sidebar for the shipping inner block Closes woocommerce/woocommerce-blocks#4320 * Fix script handles * Fix method display when there are none * Add shipping phone * Add phone to api and sync with billing correctly * Clear hidden fields on load * fix requirePhoneField property * Enable shipping and billing phone fields * readonly field support * Handle context attributes * Fix createInterpolateElement usage * add totalswrapper * Implement Terms and Conditions block for Checkout i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4436) * Setup atomic blocks * frontend WIP * Express block * try/block-registry * Set correct parent blocks for inner blocks * Skeleton styling * Refactor to avoid duplicating atomic block logic * add block locking * add terms and conditions block * hardcore settings image * lock blocks from being deleted * hide original checkout block * mark blocks as side effectful * move variations to block register function * prevent core checkout blocks from needlessly showing in the inserter * enable checkout i1 * fix broken rebase * move save back * Localise default text Co-authored-by: Mike Jolley <mike.jolley@me.com> * Add add-hoc Block locking from WooCommerce Blocks side. (https://github.com/woocommerce/woocommerce-blocks/pull/4454) * add locking * use subscribe instead * fix condition * add locking to blocks * check if the item is not a text field * Tidy up hacks CSS class handling * Fix error if node is undefined * Hide menu when move is disabled * update package lock * Add todo and fix issue where selector returns null * split todos * move todo * edit comment Co-authored-by: Mike Jolley <mike.jolley@me.com> * Un-disable the billing checkbox in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4457) * Add missing Slot fill provider on frontend Fixes woocommerce/woocommerce-blocks#4441 by adding the slot fill provider to the checkout-i2 block. * Use column style appender * Add padding/styles to actions * Add/update icon library * Multiline checkbox alignment * Icons and copy changes for i2 blocks * Add terms by default * Add notice if text is missing links (https://github.com/woocommerce/woocommerce-blocks/pull/4466) * Swap variations for toggle * Add payment settings to inspector * Update package lock * Add inline docs to block registry * Add inner block areas below each form step. This does not include the form step contents, just adds inner blocks after existing content. Moving content within the inner block area is a separate discussion. This closes woocommerce/woocommerce-blocks#4306 * Sample block registration + docs * Add tests for registerCheckoutBlock * Fix lazy component detection in tests * Add basic transform between i1 and i2 * remove template lock todo * Update scroll to top hoc * Move shared settings to new context providers Closes woocommerce/woocommerce-blocks#4472 * Remove readonly field support (unused) * Remove context code * Experimental * remove invalid typedef * FIx scrolling on validation due to misplaced context provider * Update assets/js/base/context/providers/cart-checkout/checkout-state/index.tsx Co-authored-by: Darren Ethier <darren@roughsmootheng.in> * Update comment to remove reference to phone * Update packages/checkout/blocks-registry/README.md Co-authored-by: Darren Ethier <darren@roughsmootheng.in> * Rename ScrollToTopComponent * Add explicit list of expectedType in TypeScript definition * Add todo to remove custom shipping phone handling * Remove dangerouslySetInnerHTML in External Link Card Component * Add ExternalLinkCard to storybook * update todo wording * Refactor withScrollToTop to remove useCallback and use typescript * Support children on CheckboxControl, with added Typescript * Spread getRegisteredBlocks return value Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com> Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-07-22 11:03:00 +00:00
.wc-block-components-checkout-step__content > * {
margin-bottom: $gap;
&:last-child {
margin-bottom: 0;
}
WIP - Checkout i2 Feature Branch Tracking (https://github.com/woocommerce/woocommerce-blocks/pull/4268) * Duplicate checkout block * Contact information block * form step block * shipping address block * Setup atomic blocks * Container structure * More formal steps rather than generic form step * Add billing and shipping forms * add checkout actions block * add order note block * Add order summary * add payment block * Add inspector controls for address fields * frontend WIP * move attributes * wrap shipping with form step * PhoneNumber to typescript * Remove column block * form steps * move payment logic to frontend * Express block * inline payment block * Add shipping method block * Render inner blocks (not standalone blocks) and add classes to Atomic Block list on php side * lazy again * Add more wrappers from old frontend file * add layout * Checkout wrappers were missing * Enqueue payment methods for new block * Add missing classnames * Move shipping as billing state to context provider * express payments rendering * try/block-registry * Remove atomic components (unused) * Fix attribute persistance due to template locking * Fix shipping display when not needed * Set correct parent blocks for inner blocks * pass data to blocks * demo/newsletter * Skeleton styling * only apply styles to loading state for now * shipping method block frontend * rename express block * lock template * fix ts warning for __webpack_public_path__ * Refactor to avoid duplicating atomic block logic * remove changes in save method * Add zones and shipping methods to the sidebar for the shipping inner block Closes woocommerce/woocommerce-blocks#4320 * Fix script handles * Fix method display when there are none * Add shipping phone * Add phone to api and sync with billing correctly * Clear hidden fields on load * fix requirePhoneField property * Enable shipping and billing phone fields * readonly field support * Handle context attributes * Fix createInterpolateElement usage * add totalswrapper * Implement Terms and Conditions block for Checkout i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4436) * Setup atomic blocks * frontend WIP * Express block * try/block-registry * Set correct parent blocks for inner blocks * Skeleton styling * Refactor to avoid duplicating atomic block logic * add block locking * add terms and conditions block * hardcore settings image * lock blocks from being deleted * hide original checkout block * mark blocks as side effectful * move variations to block register function * prevent core checkout blocks from needlessly showing in the inserter * enable checkout i1 * fix broken rebase * move save back * Localise default text Co-authored-by: Mike Jolley <mike.jolley@me.com> * Add add-hoc Block locking from WooCommerce Blocks side. (https://github.com/woocommerce/woocommerce-blocks/pull/4454) * add locking * use subscribe instead * fix condition * add locking to blocks * check if the item is not a text field * Tidy up hacks CSS class handling * Fix error if node is undefined * Hide menu when move is disabled * update package lock * Add todo and fix issue where selector returns null * split todos * move todo * edit comment Co-authored-by: Mike Jolley <mike.jolley@me.com> * Un-disable the billing checkbox in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4457) * Add missing Slot fill provider on frontend Fixes woocommerce/woocommerce-blocks#4441 by adding the slot fill provider to the checkout-i2 block. * Use column style appender * Add padding/styles to actions * Add/update icon library * Multiline checkbox alignment * Icons and copy changes for i2 blocks * Add terms by default * Add notice if text is missing links (https://github.com/woocommerce/woocommerce-blocks/pull/4466) * Swap variations for toggle * Add payment settings to inspector * Update package lock * Add inline docs to block registry * Add inner block areas below each form step. This does not include the form step contents, just adds inner blocks after existing content. Moving content within the inner block area is a separate discussion. This closes woocommerce/woocommerce-blocks#4306 * Sample block registration + docs * Add tests for registerCheckoutBlock * Fix lazy component detection in tests * Add basic transform between i1 and i2 * remove template lock todo * Update scroll to top hoc * Move shared settings to new context providers Closes woocommerce/woocommerce-blocks#4472 * Remove readonly field support (unused) * Remove context code * Experimental * remove invalid typedef * FIx scrolling on validation due to misplaced context provider * Update assets/js/base/context/providers/cart-checkout/checkout-state/index.tsx Co-authored-by: Darren Ethier <darren@roughsmootheng.in> * Update comment to remove reference to phone * Update packages/checkout/blocks-registry/README.md Co-authored-by: Darren Ethier <darren@roughsmootheng.in> * Rename ScrollToTopComponent * Add explicit list of expectedType in TypeScript definition * Add todo to remove custom shipping phone handling * Remove dangerouslySetInnerHTML in External Link Card Component * Add ExternalLinkCard to storybook * update todo wording * Refactor withScrollToTop to remove useCallback and use typescript * Support children on CheckboxControl, with added Typescript * Spread getRegisteredBlocks return value Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com> Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-07-22 11:03:00 +00:00
}
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content > :last-child {
margin-bottom: 0;
}
.wc-block-checkout__contact-fields .wc-block-components-checkout-step__heading {
margin-top: em($gap-smaller);
}
.wc-block-components-checkout-step__heading {
margin: 0 0 $gap-smaller;
position: relative;
.wc-block-components-express-payment-continue-rule + .wc-block-components-checkout-step & {
margin-top: 0;
}
}
.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading {
margin-top: 0;
}
.wc-block-components-checkout-step__title {
margin: 0 $gap-small 0 0;
}
.wc-block-components-checkout-step__heading-content {
@include font-size(smaller);
a {
font-weight: bold;
color: inherit;
}
}
.wc-block-checkout__payment-method .wc-block-components-checkout-step__content {
padding-top: $gap-smaller;
}
.wc-block-components-checkout-step__description {
@include font-size(small);
line-height: 1.2;
margin: 0 0 $gap;
}
.wc-block-checkout__form--with-step-numbers {
.wc-block-components-checkout-step--with-step-number {
padding: 0 0 0 $gap-larger;
.wc-block-components-checkout-step__title::before {
@include reset-box();
background: transparent;
counter-increment: checkout-step;
content: "\00a0" counter(checkout-step) ".";
content: "\00a0" counter(checkout-step) "." / "";
position: absolute;
left: -$gap-large;
top: 0;
text-align: center;
transform: translateX(-50%);
white-space: nowrap;
.is-mobile &,
.is-small & {
position: static;
transform: none;
left: auto;
top: auto;
content: counter(checkout-step) ".\00a0";
content: counter(checkout-step) ".\00a0" / "";
}
}
.wc-block-components-checkout-step__container::after {
content: "";
height: 100%;
border-left: 1px solid $universal-border-light;
position: absolute;
left: -$gap-large;
top: 0;
}
.is-mobile &,
.is-small & {
.wc-block-components-checkout-step__title::before {
position: static;
transform: none;
left: auto;
top: auto;
content: counter(checkout-step) ".\00a0";
content: counter(checkout-step) ".\00a0" / "";
}
.wc-block-components-checkout-step__container::after {
content: unset;
}
}
}
}
.editor-styles-wrapper {
.wp-block h4.wc-block-components-checkout-step__title {
@include font-size(regular);
line-height: 24px;
margin: 0 $gap-small 0 0;
}
}