block_name . '/block.json', array( 'render_callback' => array( $this, 'render_css' ), ) ); } /** * Builds CSS for block. * * @param array $attributes the blocks attributes. * @param Kadence_Blocks_CSS $css the css class for blocks. * @param string $unique_id the blocks attr ID. * @param string $unique_style_id the blocks alternate ID for queries. */ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { $css->set_style_id( 'kb-' . $this->block_name . $unique_style_id ); $css->set_selector( '.kb-table-container .kb-table tr.kb-table-row' . $unique_id ); $css->add_property( 'background-color', $css->render_color( $attributes['backgroundColor'] ) ); $css->render_responsive_size( $attributes, [ 'minHeight', 'tabletMinHeight', 'mobileMinHeight' ], 'height' ); $css->set_selector( '.kb-table-container .kb-table tr.kb-table-row' . $unique_id . ':hover' ); $css->add_property( 'background-color', $css->render_color( $attributes['backgroundHoverColor'] ) ); return $css->css_output(); } /** * Return dynamically generated HTML for block * * @param $attributes * @param $unique_id * @param $content * @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered. * * @return mixed */ public function build_html( $attributes, $unique_id, $content, $block_instance ) { return sprintf( '