Skip to content

Commit

Permalink
Fix block content bg color and card media height - fixes #144
Browse files Browse the repository at this point in the history
  • Loading branch information
razwan committed Apr 22, 2020
1 parent 1bb6d94 commit 2724850
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/css/editor-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/frontend-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/frontend.css

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/blocks/cards-collection/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,22 @@ function novablocks_render_cards_collection_block( $attributes, $content ) {

function get_card_media_padding_top( $containerHeight ) {
$containerHeight = $containerHeight / 50 - 1;

if ( $containerHeight < 0 ) {
$containerHeight *= 3;
}

$numerator = 1;
$denominator = 1;

$containerHeight = min( max( -1, $containerHeight ), 1 );
$containerHeight = min( max( -3, $containerHeight ), 1 );

if ( $containerHeight > 0 ) {
$numerator = 1 + $containerHeight;
}

if ( $containerHeight < 0 ) {
$containerHeight = 1 + abs( $containerHeight );
$denominator = 1 + abs( $containerHeight );
}

return ( $numerator * 100 / $denominator ) . '%';
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_emphasis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
@include above(tablet) {
box-shadow: var(--novablocks-block-content-box-shadow);

&:after {
&:before {
content: '';
position: absolute;
top: 0;
Expand Down

0 comments on commit 2724850

Please sign in to comment.