forked from godaddy-wordpress/coblocks
-
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.
Refactor to use proper spacing utilities (godaddy-wordpress#1253)
* Initial organization of utitlies * Clean accordion styles * Clean alert styles * Clean author * Move stacked shadow control to the bottom * Clean and organize common vars * Clean and remove excess classes from background component * Use break-small() instead of hardcoding media query * Remove unused utilities * Add organized utilities * Clean up editor-only utilities * Clean and organize block gallery styles * Update services block with revised columns and gutter utilities * Update features block with revised columns and gutter utilities * Update features block test * Update collage block with proper utilities (plus deprecation) * Update _datepicker.scss * Clean up row block styles * Clean up post carousel * Clean up posts block * Rename "columns" utility to "has-columns" * Rename scss files * Remove unneeded utilities on Offset Gallery * Move format utility into the proper directory * Update Posts block with cleaned up styling and utilities * Clean up post carousel * Update offset gallery style * Clean utilities again * Clean excess comments * Clean more utilities * Update edit.js * Remove editor utility padding * Use utilities in Offset gallery * Move utilities into post carousel style * Move utilities into posts block styles * Move unused utilities * Organizing more * Add deprecations * Update block.json * test_coblocks_render_posts_block * Update save.spec.js.snap * Fix test_coblocks_render_posts_block unit test * Tweak offset deprecation * Remove unused component from Offset deprecation * Try migrate for offset (not working) * Try again, not working * Fix offset components-placeholder spacing * Change Larger to Huge (to match existing size patterns) * Try new migration * Update deprecated.js * Update deprecated.js * Update deprecated.js * Update deprecated.js * Fix gutter * Features * Fix responsive class * Fix columns class on Features * Update deprecated.js * Finish Features deprecation * Finish Features deprecation * Fix offset * Migrate Collage to utilities * Tweaks * Finish collage dep * Responsive collage styles * Remove last unused utils * Tweaks for offset image size class * Minor typo in deprecation * Add legacy margin/padding * Add support for legacy collage block * Legacy styles for Features * Legacy styles for Services * Tweaking services legacy styling * Finish services legacy styling * Tweak for Row * Fix gutter-none option for legacy collage block * Fix no-gutter collage Co-authored-by: Evan Herman <[email protected]> Co-authored-by: JR Tashjian <[email protected]>
- Loading branch information
1 parent
524bd86
commit 8ad59ea
Showing
129 changed files
with
2,628 additions
and
2,578 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
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
.block-editor-block-styles .wp-block-coblocks-alert { | ||
background-color: $alert-default-background-color !important; | ||
color: $alert-default-color !important; | ||
background-color: $color-alert-default-bg !important; | ||
color: $color-alert-default-color !important; | ||
|
||
&.is-style-warning { | ||
background-color: $alert-warning-background-color !important; | ||
color: $alert-warning-color !important; | ||
background-color: $color-alert-warning-bg !important; | ||
color: $color-alert-warning-color !important; | ||
} | ||
|
||
&.is-style-error { | ||
background-color: $alert-error-background-color !important; | ||
color: $alert-error-color !important; | ||
background-color: $color-alert-error-bg !important; | ||
color: $color-alert-error-color !important; | ||
} | ||
|
||
&.is-style-success { | ||
background-color: $alert-success-background-color !important; | ||
color: $alert-success-color !important; | ||
background-color: $color-alert-success-bg !important; | ||
color: $color-alert-success-color !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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
} | ||
|
||
.wp-block-coblocks-author { | ||
|
||
&__avatar { | ||
background: $white; | ||
position: relative; | ||
|
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
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,40 @@ | ||
.is-twentytwenty { | ||
.entry-content hr.wp-block-coblocks-dynamic-separator { | ||
&::before { | ||
background: none; | ||
content: "..."; | ||
left: 0; | ||
top: calc(50% - 18px); | ||
transform: none; | ||
width: auto; | ||
} | ||
|
||
&::after { | ||
display: none; | ||
} | ||
|
||
&.is-style-line::before, | ||
&.is-style-fullwidth::before { | ||
background: currentColor; | ||
content: ""; | ||
display: block; | ||
height: 1px; | ||
margin-left: auto; | ||
max-width: 120px; | ||
top: 50%; | ||
width: 15vw; | ||
} | ||
|
||
&.is-style-fullwidth::before { | ||
max-width: 100%; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.wp-block-coblocks-dynamic-separator.is-style-line:not(.has-background), | ||
.wp-block-coblocks-dynamic-separator.is-style-fullwidth:not(.has-background) { | ||
&::before { | ||
background: #6d6d6d; // Color from TwentyTwenty | ||
} | ||
} | ||
} |
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,79 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classnames from 'classnames'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import metadata from './block.json'; | ||
import { BackgroundStyles, BackgroundClasses, BackgroundVideo, BackgroundAttributes } from '../../components/background'; | ||
import DimensionsAttributes from '../../components/dimensions-control/attributes'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks, getColorClassName } from '@wordpress/block-editor'; | ||
|
||
const deprecated = | ||
[ { | ||
attributes: { | ||
...DimensionsAttributes, | ||
...BackgroundAttributes, | ||
...metadata.attributes, | ||
gutter: { | ||
type: 'string', | ||
default: 'large', | ||
}, | ||
}, | ||
save( { attributes, className } ) { | ||
const { | ||
coblocks, | ||
columns, | ||
contentAlign, | ||
customTextColor, | ||
textColor, | ||
gutter, | ||
marginSize, | ||
paddingSize, | ||
} = attributes; | ||
|
||
// Body color class and styles. | ||
const textClass = getColorClassName( 'color', textColor ); | ||
|
||
let classes = className; | ||
|
||
if ( coblocks && ( typeof coblocks.id !== 'undefined' ) ) { | ||
classes = classnames( classes, `coblocks-features-${ coblocks.id }` ); | ||
} | ||
|
||
const innerClasses = classnames( | ||
'wp-block-coblocks-features__inner', | ||
...BackgroundClasses( attributes ), { | ||
'has-text-color': textColor || customTextColor, | ||
[ textClass ]: textClass, | ||
'has-padding': paddingSize && paddingSize !== 'no', | ||
[ `has-${ paddingSize }-padding` ]: paddingSize && ( paddingSize !== 'advanced' ), | ||
'has-margin': marginSize && marginSize !== 'no', | ||
[ `has-${ marginSize }-margin` ]: marginSize && ( marginSize !== 'advanced' ), | ||
[ `has-${ gutter }-gutter` ]: gutter, | ||
[ `has-${ contentAlign }-content` ]: contentAlign, | ||
} ); | ||
|
||
const innerStyles = { | ||
...BackgroundStyles( attributes ), | ||
color: textClass ? undefined : customTextColor, | ||
}; | ||
|
||
return ( | ||
<div className={ classes } data-columns={ columns }> | ||
<div className={ innerClasses } style={ innerStyles }> | ||
{ BackgroundVideo( attributes ) } | ||
<InnerBlocks.Content /> | ||
</div> | ||
</div> | ||
); | ||
}, | ||
} ]; | ||
|
||
export default deprecated; |
Oops, something went wrong.