Astra_Customizer::get_formatted_font_style( string $tag )
Get formatted font settings for headings.
Description
Parameters
- $tag
-
(string) (Required) HTML Tag.
Return
(string) formatted string with font, font-size, line-height.
Source
File: inc/customizer/class-astra-customizer.php
public function get_formatted_font_style( $tag ) {
$dataset = array();
$dataset[] = '<span class="ast-sg-font-family">' . astra_get_option( 'font-family-' . $tag ) . '</span>';
$font_size = astra_get_option( 'font-size-' . $tag );
$desktop = astra_get_css_value( $font_size['desktop'], $font_size['desktop-unit'] );
$tablet = astra_get_css_value( $font_size['tablet'], $font_size['tablet-unit'] );
$mobile = astra_get_css_value( $font_size['mobile'], $font_size['mobile-unit'] );
$tablet = empty( $tablet ) ? $desktop : $tablet;
$mobile = empty( $mobile ) ? $tablet : $mobile;
$dataset[] = '<span class="ast-sg-font-size"> <span class="ast-sg-desktop">' . $desktop . '</span> <span class="ast-sg-tablet">' . $tablet . '</span> <span class="ast-sg-mobile">' . $mobile . '</span> </span>';
$dataset[] = '<span class="ast-sg-line-height">' . astra_get_font_extras( astra_get_option( 'font-extras-' . $tag ), 'line-height', 'line-height-unit' ) . '</span>';
$formatted_data = join( ' / ', $dataset );
return '<p class="ast-sg-field-title ast-sg-typo-field" data-for="' . esc_attr( $tag ) . '"> ' . $formatted_data . ' </p>';
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |