Skip to content

Commit

Permalink
Adjust paragraph block spacing to use standardised variables (#14679)
Browse files Browse the repository at this point in the history
* Adds vars for Block padding when background present

There are a number of cases where a backgroud is added to a Block which then requires that the Block has padding within the Editor to make it look visally acceptable. These values are often hardcoded. To standardise these, we add vars for vertical and hoz padding for Blocks which have background applied.

* Adds new Block with background vars to paragraph Block

Replaces existing values with equivalents but as variables. This will allow us to utilise these standardised vars elsewhere such as the Section Block.

* Updates variable to BEM specification
  • Loading branch information
getdave authored Apr 10, 2019
1 parent 4915243 commit 410c3e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ $block-spacing: 4px; // Vertical space between blocks.
$block-side-ui-width: 28px; // Width of the movers/drag handle UI.
$block-side-ui-clearance: 2px; // Space between movers/drag handle UI, and block.
$block-container-side-padding: $block-side-ui-width + $block-padding + 2 * $block-side-ui-clearance; // Total space left and right of the block footprint.
$block-bg-padding--v: $block-padding + $block-spacing + $block-side-ui-clearance; // padding for Blocks with a background color (eg: paragraph or section)
$block-bg-padding--h: $block-side-ui-width + $block-side-ui-clearance; // padding for Blocks with a background color (eg: paragraph or section)

// Buttons & UI Widgets
$radius-round-rectangle: 4px;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/paragraph/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

p.has-background {
padding: 20px 30px;
padding: $block-bg-padding--v $block-bg-padding--h;
}

p.has-text-color a {
Expand Down

0 comments on commit 410c3e0

Please sign in to comment.