Skip to content

Instantly share code, notes, and snippets.

@justintadlock
Last active June 11, 2021 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justintadlock/479210f63ce97f980efd37d6392cf2e9 to your computer and use it in GitHub Desktop.
Save justintadlock/479210f63ce97f980efd37d6392cf2e9 to your computer and use it in GitHub Desktop.
Moves the "percent" metadata next to the bar for Tiles Progress Bar Block
<?php
register_block_style( 'tiles/progress', [
'name' => 'percent-side',
'label' => 'Percent Side',
'inline_style' => '
.wp-block-tiles-progress.is-style-percent-side {
line-height: 1;
}
.wp-block-tiles-progress.is-style-percent-side .wp-block-tiles-progress__background,
.wp-block-tiles-progress.is-style-percent-side .wp-block-tiles-progress__foreground {
border-radius: 0;
height: 2rem;
}
.wp-block-tiles-progress.is-style-percent-side .wp-block-tiles-progress__background {
max-width: calc( 100% - 3em );
}
.wp-block-tiles-progress.is-style-percent-side .wp-block-tiles-progress__percentage {
margin-top: 2em;
margin-bottom: calc( -2rem - 1em );
font-family: monospace;
}
'
] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment