forked from woocommerce/woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MVP QA woocommerce#1] Visual: spacings (woocommerce#38325)
* Update the margin-left on the buttons in the top bar from 16px to 8px * On mobile, the left and right body margins should be 32 px * The inner padding in the tab in the top bar should be 12px, not 16px * In the edit product link modal, let's set this modal’s width to 650 px and remove the line separating the header from the contents * All modals should now have 8 px window radius * In the feedback form, can we fix the buttons at the bottom * The help icon in checkboxes small, detached from the item label, and vertically misaligned. Left margin of 4 px, no vertical adjustment; somehow it has a -2px set for the top margin) * Fix block-editor-block-contextual-toolbar top position * When the product is in a draft state, the button in the top bar should say Add, not Save. It should change into Update once it's published on the store * Fix layout margin top * Add ection support for blockGap and set title and description to optional * Remove non needed control field margin bottom * Fix schedule sale block spacing * Remove non needed control field help text margin bottom * Remove the sub section outer spacing * Move pricing fields into a sub section block * Fix collapsible-contet margin top * Remove invalid inner block layout spacing * Wrap sku, stock toogle and quantity within a sub section * Group inventory advance section inner blocks into a sub section * Fix linter error * Add changelog files * Fix php lint error * Change unit names to fit GB definitions see: https://github.com/WordPress/gutenberg/blob/b2c16f3c684098a8dabff3911c610caa5c053701/packages/base-styles/_variables.scss\#L31-L41
- Loading branch information
Showing
22 changed files
with
354 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix collapsible content heading alignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix modal border radius and content scrolling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add sub section and section spacing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
packages/js/product-editor/src/blocks/checkbox/editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
|
||
.woocommerce-product-form__checkbox { | ||
|
||
.components-base-control__field { | ||
.components-base-control__field, | ||
.components-checkbox-control__label, | ||
&-wrapper, | ||
&-tooltip-icon { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.components-checkbox-control__label { | ||
display: flex; | ||
} | ||
|
||
&-tooltip-icon { | ||
margin: -2px 0 0 $gap-small; | ||
.components-base-control__field { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.woocommerce-product-form__checkbox-wrapper { | ||
gap: $gap-smallest; | ||
} | ||
|
||
.woocommerce-product-form__checkbox-tooltip { | ||
.components-popover__content { | ||
width: 200px; | ||
min-width: auto; | ||
white-space: normal !important; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 2 additions & 18 deletions
20
packages/js/product-editor/src/blocks/schedule-sale/editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
.wp-block-woocommerce-product-schedule-sale-fields { | ||
margin-bottom: $gap-large; | ||
|
||
.components-toggle-control { | ||
margin-bottom: $gap; | ||
padding-bottom: $gap-smaller; | ||
} | ||
|
||
.components-toggle-control__label { | ||
display: flex; | ||
align-items: center; | ||
} | ||
} | ||
|
||
.wp-block-woocommerce-product-section { | ||
> .block-editor-inner-blocks > .block-editor-block-list__layout { | ||
> .wp-block.wp-block-woocommerce-product-schedule-sale-fields:not( :first-child ) { | ||
margin-top: $gap; | ||
} | ||
&__content { | ||
margin-top: $gap-large; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,57 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classNames from 'classnames'; | ||
import { createElement } from '@wordpress/element'; | ||
import type { BlockEditProps } from '@wordpress/blocks'; | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
import { | ||
useBlockProps, | ||
// @ts-expect-error no exported member. | ||
useInnerBlocksProps, | ||
} from '@wordpress/block-editor'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { SectionBlockAttributes } from './types'; | ||
import { sanitizeHTML } from '../../utils/sanitize-html'; | ||
import { SectionBlockAttributes } from './types'; | ||
|
||
export function Edit( { | ||
attributes, | ||
}: BlockEditProps< SectionBlockAttributes > ) { | ||
const { description, title, blockGap } = attributes; | ||
const blockProps = useBlockProps(); | ||
const { description, title } = attributes; | ||
const innerBlockProps = useInnerBlocksProps( | ||
{ | ||
className: classNames( | ||
'wp-block-woocommerce-product-section__content', | ||
`wp-block-woocommerce-product-section__content--block-gap-${ blockGap }` | ||
), | ||
}, | ||
{ templateLock: 'all' } | ||
); | ||
const SectionTagName = title ? 'fieldset' : 'div'; | ||
const HeadingTagName = SectionTagName === 'fieldset' ? 'legend' : 'div'; | ||
|
||
return ( | ||
<div { ...blockProps }> | ||
<h2 className="wp-block-woocommerce-product-section__title"> | ||
<span>{ title }</span> | ||
</h2> | ||
{ description && ( | ||
<p | ||
className="wp-block-woocommerce-product-section__description" | ||
dangerouslySetInnerHTML={ sanitizeHTML( description ) } | ||
/> | ||
<SectionTagName { ...blockProps }> | ||
{ title && ( | ||
<HeadingTagName className="wp-block-woocommerce-product-section__heading"> | ||
<h2 className="wp-block-woocommerce-product-section__heading-title"> | ||
{ title } | ||
</h2> | ||
{ description && ( | ||
<p | ||
className="wp-block-woocommerce-product-section__heading-description" | ||
dangerouslySetInnerHTML={ sanitizeHTML( | ||
description | ||
) } | ||
/> | ||
) } | ||
</HeadingTagName> | ||
) } | ||
<InnerBlocks templateLock="all" /> | ||
</div> | ||
|
||
<div { ...innerBlockProps } /> | ||
</SectionTagName> | ||
); | ||
} |
76 changes: 54 additions & 22 deletions
76
packages/js/product-editor/src/blocks/section/editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,61 @@ | ||
.wp-block-woocommerce-product-section { | ||
margin-bottom: 48px; | ||
padding-top: 48px; | ||
margin: calc(3 * $gap) 0 0; | ||
padding: 0 0 calc(3 * $gap); | ||
border-bottom: 1px solid #ddd; | ||
|
||
&:first-child { | ||
padding-top: 64px; | ||
margin-top: calc(4 * $gap); | ||
} | ||
|
||
.wp-block-woocommerce-product-section__title { | ||
margin-top: 0; | ||
margin-bottom: 0; | ||
font-size: 20px; | ||
font-weight: 500; | ||
color: $gray-900; | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
|
||
&__description { | ||
margin-top: $gap-small; | ||
font-size: 13px; | ||
color: $gray-700; | ||
line-height: 1.5; | ||
} | ||
} | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
|
||
&__heading { | ||
padding: 0; | ||
margin: 0 0 calc(2 * $gap) 0; | ||
width: 100%; | ||
|
||
.wp-block-woocommerce-product-section__heading-title { | ||
margin: 0; | ||
font-size: 20px; | ||
font-weight: 500; | ||
color: $gray-900; | ||
display: inline-flex; | ||
align-items: center; | ||
|
||
.block-editor-block-icon { | ||
margin-right: 14px; | ||
|
||
> div { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
} | ||
} | ||
|
||
.wp-block-woocommerce-product-section + .wp-block-woocommerce-product-section { | ||
border-top: 1px solid #ddd; | ||
.wp-block-woocommerce-product-section__heading-description { | ||
margin: $gap-small 0 0; | ||
font-size: 13px; | ||
color: $gray-700; | ||
line-height: 1.5; | ||
} | ||
} | ||
|
||
&__content { | ||
&--block-gap-unit-30 > * + * { | ||
margin-top: $grid-unit-30; | ||
} | ||
|
||
&--block-gap-unit-40 > * + * { | ||
margin-top: $grid-unit-40; | ||
} | ||
|
||
.wp-block-woocommerce-product-section { | ||
margin-top: 0; | ||
padding-bottom: 0; | ||
border-bottom: none; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.