Adds font settings options to sections, metadata label and value.
This commit is contained in:
parent
c71b9e48f9
commit
7802fcbedb
|
@ -24,7 +24,8 @@ add_action( 'wp_enqueue_scripts', function () {
|
|||
add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
|
||||
blocksy_theme_get_dynamic_styles(array_merge([
|
||||
'path' => get_stylesheet_directory() . '/global.php',
|
||||
'chunk' => 'global'
|
||||
'chunk' => 'global',
|
||||
'forced_call' => true
|
||||
], $args));
|
||||
}, 10, 3);
|
||||
});
|
||||
|
|
50
global.php
50
global.php
|
@ -1,18 +1,14 @@
|
|||
<?php
|
||||
|
||||
if (! isset($prefix)) {
|
||||
$prefix = '';
|
||||
} else {
|
||||
$prefix = $prefix . '_';
|
||||
}
|
||||
$prefix = blocksy_manager()->screen->get_prefix();
|
||||
|
||||
blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
|
||||
'css' => $css,
|
||||
'tablet_css' => $tablet_css,
|
||||
'mobile_css' => $mobile_css,
|
||||
'selector' => ".tainacan-item-section__metadata",
|
||||
'selector' => blocksy_prefix_selector('.tainacan-item-section__metadata', $prefix),
|
||||
'variableName' => 'column-width',
|
||||
'value' => get_theme_mod($prefix . '_metadata_columns', [
|
||||
'value' => get_theme_mod( $prefix . '_tainacan_metadata_columns', [
|
||||
'mobile' => '200px',
|
||||
'tablet' => '300px',
|
||||
'desktop' => '400px',
|
||||
|
@ -20,4 +16,44 @@ blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
|
|||
'unit' => ''
|
||||
]);
|
||||
|
||||
blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
|
||||
'css' => $css,
|
||||
'tablet_css' => $tablet_css,
|
||||
'mobile_css' => $mobile_css,
|
||||
'selector' => blocksy_prefix_selector('.tainacan-single-item-section', $prefix),
|
||||
'font_value' => get_theme_mod($prefix . '_tainacan_single_item_section_font',
|
||||
blocksy_typography_default_values([
|
||||
'size' => '26px',
|
||||
'variation' => 'n6',
|
||||
'line-height' => '1.3'
|
||||
])
|
||||
)
|
||||
]);
|
||||
|
||||
blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
|
||||
'css' => $css,
|
||||
'tablet_css' => $tablet_css,
|
||||
'mobile_css' => $mobile_css,
|
||||
'selector' => blocksy_prefix_selector('.tainacan-metadata-label', $prefix),
|
||||
'font_value' => get_theme_mod($prefix . '_tainacan_metadata_label_font',
|
||||
blocksy_typography_default_values([
|
||||
'size' => '22px',
|
||||
'variation' => 'n6',
|
||||
'line-height' => '1.2'
|
||||
])
|
||||
)
|
||||
]);
|
||||
|
||||
blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
|
||||
'css' => $css,
|
||||
'tablet_css' => $tablet_css,
|
||||
'mobile_css' => $mobile_css,
|
||||
'selector' => blocksy_prefix_selector('.tainacan-metadata-value', $prefix),
|
||||
'font_value' => get_theme_mod($prefix . '_tainacan_metadata_value_font',
|
||||
blocksy_typography_default_values([
|
||||
'size' => '17px'
|
||||
])
|
||||
)
|
||||
]);
|
||||
|
||||
?>
|
|
@ -5,7 +5,7 @@ if (! isset($prefix)) {
|
|||
}
|
||||
|
||||
$options = [
|
||||
$prefix . 'metadata_columns' => [
|
||||
$prefix . 'tainacan_metadata_columns' => [
|
||||
'label' => __( 'Metadata columns width', 'blocksy-tainacan' ),
|
||||
'type' => 'ct-slider',
|
||||
'value' => [
|
||||
|
|
|
@ -24,6 +24,9 @@ $options = [
|
|||
], false),
|
||||
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-columns.php', [
|
||||
'prefix' => $prefix
|
||||
], false),
|
||||
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-typography.php', [
|
||||
'prefix' => $prefix
|
||||
], false)
|
||||
]
|
||||
]
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
if (! isset($prefix)) {
|
||||
$prefix = '';
|
||||
}
|
||||
if (! isset($enabled)) {
|
||||
$enabled = 'no';
|
||||
}
|
||||
|
||||
$options = [
|
||||
$prefix . 'tainacan_metadata_label_font' => [
|
||||
'type' => 'ct-typography',
|
||||
'label' => __( 'Metadata label', 'blocksy' ),
|
||||
'value' => blocksy_typography_default_values([
|
||||
'size' => '22px',
|
||||
'variation' => 'n6',
|
||||
'line-height' => '1.2'
|
||||
]),
|
||||
'divider' => 'top',
|
||||
'sync' => blocksy_sync_single_post_container([
|
||||
'prefix' => $prefix
|
||||
])
|
||||
],
|
||||
$prefix . 'tainacan_metadata_value_font' => [
|
||||
'type' => 'ct-typography',
|
||||
'label' => __( 'Metadata value', 'blocksy' ),
|
||||
'value' => blocksy_typography_default_values([
|
||||
'size' => '17px'
|
||||
]),
|
||||
'sync' => blocksy_sync_single_post_container([
|
||||
'prefix' => $prefix
|
||||
])
|
||||
],
|
||||
];
|
|
@ -20,6 +20,19 @@ $options = [
|
|||
'prefix' => $prefix,
|
||||
]),
|
||||
'inner-options' => [
|
||||
$prefix . 'tainacan_single_item_section_font' => [
|
||||
'type' => 'ct-typography',
|
||||
'label' => __( 'Section labels font', 'blocksy' ),
|
||||
'value' => blocksy_typography_default_values([
|
||||
'size' => '26px',
|
||||
'variation' => 'n6',
|
||||
'line-height' => '1.3'
|
||||
]),
|
||||
'divider' => 'top',
|
||||
'sync' => blocksy_sync_single_post_container([
|
||||
'prefix' => $prefix
|
||||
])
|
||||
],
|
||||
blocksy_rand_md5() => [
|
||||
'type' => 'ct-condition',
|
||||
'condition' => [
|
||||
|
|
|
@ -235,6 +235,7 @@ body:not(.tainacan-admin-page) {
|
|||
align-items: center;
|
||||
background-color: var(--backgroundColor, #f8f9fb);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
// We also apply this here as we want to keep the same style of the .theme-items-list
|
||||
|
|
|
@ -291,6 +291,9 @@
|
|||
// Metadata list -------------------------------------
|
||||
.tainacan-item-section__metadata {
|
||||
height: 100%;
|
||||
-moz-column-width: var(--column-width, 400);
|
||||
-webkit-column-width: var(--column-width, 400);
|
||||
column-width: var(--column-width, 400);
|
||||
|
||||
div {
|
||||
-webkit-column-break-inside: avoid;
|
||||
|
@ -311,7 +314,7 @@
|
|||
-moz-column-rule: none;
|
||||
-webkit-column-gap: 0;
|
||||
-webkit-column-rule: none;
|
||||
column-gap: 4rem;;
|
||||
column-gap: 4rem;
|
||||
column-rule: none;
|
||||
}
|
||||
@media only screen and (min-width: 1366px) {
|
||||
|
@ -341,6 +344,17 @@
|
|||
p {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.tainacan-metadata-value {
|
||||
font-family: var(--fontFamily);
|
||||
font-size: var(--fontSize);
|
||||
font-weight: var(--fontWeight);
|
||||
font-style: var(--fontStyle, inherit);
|
||||
line-height: var(--lineHeight);
|
||||
letter-spacing: var(--letterSpacing);
|
||||
text-transform: var(--textTransform);
|
||||
-webkit-text-decoration: var(--textDecoration);
|
||||
text-decoration: var(--textDecoration);
|
||||
}
|
||||
.tainacan-item-section__metadata-thumbnail img {
|
||||
border-radius: var(--borderRadius, 3px);
|
||||
}
|
||||
|
|
18
style.css
18
style.css
|
@ -269,6 +269,7 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
|
|||
align-items: center;
|
||||
background-color: var(--backgroundColor, #f8f9fb);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
--tainacan-secondary: var(--paletteColor1, #3eaf7c);
|
||||
--tainacan-primary: var(--formBorderInitialColor, #e0e5eb);
|
||||
|
@ -553,7 +554,7 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
|
|||
cursor: pointer;
|
||||
word-break: break-all;
|
||||
font-size: 0.875em;
|
||||
max-width: 160px;
|
||||
max-width: 157px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 380px) {
|
||||
|
@ -637,6 +638,9 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
|
|||
|
||||
.tainacan-item-single .tainacan-item-section__metadata {
|
||||
height: 100%;
|
||||
-moz-column-width: var(--column-width, 400);
|
||||
-webkit-column-width: var(--column-width, 400);
|
||||
column-width: var(--column-width, 400);
|
||||
}
|
||||
|
||||
.tainacan-item-single .tainacan-item-section__metadata div {
|
||||
|
@ -702,6 +706,18 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
|
|||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.tainacan-item-single .tainacan-item-section__metadata .tainacan-metadata-value {
|
||||
font-family: var(--fontFamily);
|
||||
font-size: var(--fontSize);
|
||||
font-weight: var(--fontWeight);
|
||||
font-style: var(--fontStyle, inherit);
|
||||
line-height: var(--lineHeight);
|
||||
letter-spacing: var(--letterSpacing);
|
||||
text-transform: var(--textTransform);
|
||||
-webkit-text-decoration: var(--textDecoration);
|
||||
text-decoration: var(--textDecoration);
|
||||
}
|
||||
|
||||
.tainacan-item-single .tainacan-item-section__metadata .tainacan-item-section__metadata-thumbnail img {
|
||||
border-radius: var(--borderRadius, 3px);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -58,12 +58,12 @@
|
|||
|
||||
<section class="tainacan-item-section tainacan-item-section--<?php echo ((get_theme_mod($prefix . '_gallery_mode', 'no') == 'no' ? 'attachments' : 'gallery')) ?>">
|
||||
<?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && (get_theme_mod($prefix . '_gallery_mode', 'no') == 'no') && get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' )) != '' ) : ?>
|
||||
<h2 id="tainacan-item-attachments-label">
|
||||
<h2 class="tainacan-single-item-section" id="tainacan-item-attachments-label">
|
||||
<?php echo esc_html( get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' ) ) ); ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && (get_theme_mod($prefix . '_gallery_mode', 'no') == 'yes') && get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'blocksy-tainacan' )) != '') : ?>
|
||||
<h2 id="tainacan-item-documents-label">
|
||||
<h2 class="tainacan-single-item-section" id="tainacan-item-documents-label">
|
||||
<?php echo esc_html( get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'blocksy-tainacan' )) ); ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<?php if ( tainacan_has_document() && get_theme_mod($prefix . '_gallery_mode', 'no') != 'yes') : ?>
|
||||
<section class="tainacan-item-section tainacan-item-section--document">
|
||||
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' )) != '' ) : ?>
|
||||
<h2 id="tainacan-item-document-label">
|
||||
<h2 class="tainacan-single-item-section" id="tainacan-item-document-label">
|
||||
<?php echo esc_html( get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' ) ) ); ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -4,30 +4,28 @@
|
|||
|
||||
<section class="tainacan-item-section tainacan-item-section--metadata">
|
||||
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' )) != '' ) : ?>
|
||||
<h2 id="tainacan-item-metadata-label">
|
||||
<h2 class="tainacan-single-item-section" id="tainacan-item-metadata-label">
|
||||
<?php echo esc_html( get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' ) ) ); ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<div
|
||||
class="tainacan-item-section__metadata"
|
||||
style="column-width: <?php echo get_theme_mod( $prefix . '_metadata_columns', ['mobile' => '200px', 'tablet' => '300px', 'desktop' => '400px' ] )['desktop'] ?>">
|
||||
<div class="tainacan-item-section__metadata">
|
||||
<?php if (has_post_thumbnail() && (get_theme_mod($prefix . '_show_thumbnail', 'no') === 'yes') ): ?>
|
||||
<div class="tainacan-item-section__metadata-thumbnail">
|
||||
<h3><?php _e( 'Thumbnail', 'blocksy-tainacan' ); ?></h3>
|
||||
<p><?php the_post_thumbnail('tainacan-medium-full'); ?></p>
|
||||
<h3 class="tainacan-metadata-label"><?php _e( 'Thumbnail', 'blocksy-tainacan' ); ?></h3>
|
||||
<p class="tainacan-metadata-value"><?php the_post_thumbnail('tainacan-medium-full'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php do_action( 'blocksy-tainacan-single-item-metadata-begin' ); ?>
|
||||
<?php
|
||||
$args = array(
|
||||
'before_title' => '<div><h3>',
|
||||
'before_title' => '<div><h3 class="tainacan-metadata-label">',
|
||||
'after_title' => '</h3>',
|
||||
'before_value' => '<p>',
|
||||
'before_value' => '<p class="tainacan-metadata-value">',
|
||||
'after_value' => '</p></div>',
|
||||
'exclude_title' => (get_theme_mod($prefix . '_show_title_metadata', 'yes') === 'no')
|
||||
);
|
||||
tainacan_the_metadata( $args );
|
||||
?>
|
||||
<?php do_action( 'blocksy-tainacan-single-item-metadata-end' ); ?>
|
||||
</div>"
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Reference in New Issue