Adds text alignment options to all text.

This commit is contained in:
mateuswetah 2021-01-04 19:57:51 -03:00
parent cda0a7fdf6
commit ebe5e7e2c4
15 changed files with 255 additions and 91 deletions

View File

@ -31,6 +31,17 @@ blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
]);
blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
'css' => $css,
'tablet_css' => $tablet_css,
'mobile_css' => $mobile_css,
'responsive' => true,
'variableName' => 'section-alignment',
'unit' => '',
'selector' => blocksy_prefix_selector('.tainacan-single-item-section', $prefix),
'value' => get_theme_mod($prefix . '_tainacan_single_item_section_alignment', 'left')
]);
blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
'css' => $css,
'tablet_css' => $tablet_css,
@ -46,6 +57,19 @@ blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
]);
blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
'css' => $css,
'tablet_css' => $tablet_css,
'mobile_css' => $mobile_css,
'selector' => blocksy_prefix_selector('.swiper-slide-name', $prefix),
'font_value' => get_theme_mod($prefix . '_attachment_label_font',
blocksy_typography_default_values([
'size' => '0.875rem',
'line-height' => '1.5'
])
)
]);
blc_call_fnc(['fnc' => 'blocksy_output_border'], [
'css' => $css,
'tablet_css' => $tablet_css,
@ -106,4 +130,26 @@ blc_call_fnc(['fnc' => 'blocksy_output_font_css'], [
)
]);
blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
'css' => $css,
'tablet_css' => $tablet_css,
'mobile_css' => $mobile_css,
'responsive' => true,
'variableName' => 'metadata-label-alignment',
'unit' => '',
'selector' => blocksy_prefix_selector('.tainacan-metadata-label', $prefix),
'value' => get_theme_mod($prefix . '_tainacan_metadata_label_alignment', 'left')
]);
blc_call_fnc(['fnc' => 'blocksy_output_responsive'], [
'css' => $css,
'tablet_css' => $tablet_css,
'mobile_css' => $mobile_css,
'responsive' => true,
'variableName' => 'metadata-value-alignment',
'unit' => '',
'selector' => blocksy_prefix_selector('.tainacan-metadata-value', $prefix),
'value' => get_theme_mod($prefix . '_tainacan_metadata_value_alignment', 'left')
]);
?>

View File

@ -0,0 +1,19 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
$options = [
$prefix . 'attachments_label_font' => [
'type' => 'ct-typography',
'label' => __( 'Attachments label on carousel', 'blocksy-tainacan' ),
'value' => blocksy_typography_default_values([
'size' => '0.875rem',
'line-height' => '1.5'
]),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
]
];

View File

@ -41,6 +41,9 @@ $options = [
'title' => __( 'Design', 'blocksy' ),
'type' => 'tab',
'options' => [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/attachments-typography.php', [
'prefix' => $prefix
], false),
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/attachments-size.php', [
'prefix' => $prefix
], false)

View File

@ -1,42 +0,0 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
$options = [
$prefix . 'metadata_label_border' => [
'label' => __( 'Metadata label border', 'blocksy' ),
'type' => 'ct-border',
'design' => 'block',
'responsive' => true,
'setting' => [ 'transport' => 'postMessage' ],
'value' => [
'width' => 0,
'style' => 'solid',
'color' => [
'color' => 'rgba(125, 125, 125, 0.5)',
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'metadata_value_border' => [
'label' => __( 'Metadata value border', 'blocksy' ),
'type' => 'ct-border',
'design' => 'block',
'responsive' => true,
'setting' => [ 'transport' => 'postMessage' ],
'value' => [
'width' => 0,
'style' => 'solid',
'color' => [
'color' => 'rgba(125, 125, 125, 0.5)',
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
];

View File

@ -0,0 +1,60 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
$options = [
[
blocksy_rand_md5() => [
'type' => 'ct-title',
'label' => __( 'Metadata Label', 'blocksy-tainacan' ),
],
],
$prefix . 'tainacan_metadata_label_font' => [
'type' => 'ct-typography',
'label' => __( 'Font settings', 'blocksy-tainacan' ),
'value' => blocksy_typography_default_values([
'size' => '20px',
'variation' => 'n6',
'line-height' => '1.2'
]),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'tainacan_metadata_label_alignment' => [
'type' => 'ct-radio',
'label' => __( 'Text alignment', 'blocksy' ),
'value' => 'left',
'view' => 'text',
'attr' => [ 'data-type' => 'alignment' ],
'responsive' => true,
'design' => 'block',
'choices' => [
'left' => '',
'center' => '',
'right' => '',
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'metadata_label_border' => [
'label' => __( 'Separator', 'blocksy' ),
'type' => 'ct-border',
'design' => 'block',
'responsive' => true,
'setting' => [ 'transport' => 'postMessage' ],
'value' => [
'width' => 0,
'style' => 'solid',
'color' => [
'color' => 'rgba(125, 125, 125, 0.5)',
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
];

View File

@ -40,10 +40,10 @@ $options = [
'title' => __( 'Design', 'blocksy' ),
'type' => 'tab',
'options' => [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-typography.php', [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-labels.php', [
'prefix' => $prefix
], false),
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-border.php', [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/metadata-values.php', [
'prefix' => $prefix
], false)
],

View File

@ -1,34 +0,0 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
if (! isset($enabled)) {
$enabled = 'no';
}
$options = [
$prefix . 'tainacan_metadata_label_font' => [
'type' => 'ct-typography',
'label' => __( 'Metadata label', 'blocksy-tainacan' ),
'value' => blocksy_typography_default_values([
'size' => '20px',
'variation' => 'n6',
'line-height' => '1.2'
]),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'tainacan_metadata_value_font' => [
'type' => 'ct-typography',
'label' => __( 'Metadata value', 'blocksy-tainacan' ),
'value' => blocksy_typography_default_values([
'size' => '17px'
]),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
]),
'divider' => 'bottom',
],
];

View File

@ -0,0 +1,59 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
$options = [
[
blocksy_rand_md5() => [
'type' => 'ct-title',
'label' => __( 'Metadata Value', 'blocksy-tainacan' ),
],
],
$prefix . 'tainacan_metadata_value_font' => [
'type' => 'ct-typography',
'label' => __( 'Font settings', 'blocksy-tainacan' ),
'value' => blocksy_typography_default_values([
'size' => '17px'
]),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
]),
'divider' => 'bottom',
],
$prefix . 'tainacan_metadata_value_alignment' => [
'type' => 'ct-radio',
'label' => __( 'Text alignment', 'blocksy' ),
'value' => 'left',
'view' => 'text',
'attr' => [ 'data-type' => 'alignment' ],
'responsive' => true,
'design' => 'block',
'choices' => [
'left' => '',
'center' => '',
'right' => '',
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'metadata_value_border' => [
'label' => __( 'Separator', 'blocksy' ),
'type' => 'ct-border',
'design' => 'block',
'responsive' => true,
'setting' => [ 'transport' => 'postMessage' ],
'value' => [
'width' => 0,
'style' => 'solid',
'color' => [
'color' => 'rgba(125, 125, 125, 0.5)',
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
];

View File

@ -28,11 +28,28 @@ $options = [
'variation' => 'n6',
'line-height' => '1.3'
]),
'divider' => 'top',
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'tainacan_single_item_section_alignment' => [
'type' => 'ct-radio',
'label' => __( 'Section labels text alignment', 'blocksy' ),
'value' => 'left',
'view' => 'text',
'attr' => [ 'data-type' => 'alignment' ],
'responsive' => true,
'design' => 'block',
'choices' => [
'left' => '',
'center' => '',
'right' => '',
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
]),
'divider' => 'bottom',
],
blocksy_rand_md5() => [
'type' => 'ct-condition',
'condition' => [

View File

@ -90,7 +90,9 @@
h6 {
--fontSize: 14px;
}
.tainacan-single-item-section {
text-align: var(--section-alignment, left);
}
// Document, Attachment and Gallery sections -----------------
.tainacan-item-section__document {
@ -231,13 +233,24 @@
outline: none;
}
}
.swiper-slide-name {
display: block;
margin-top: 0.5rem;
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);
}
a {
width: 100%;
max-width: var(--attachments-size, 140px);
font-size: 0.875rem;
text-align: center;
word-break: break-all;
line-height: 1.5rem
}
a,
a:focus,
@ -344,7 +357,11 @@
p {
word-wrap: break-word;
}
.tainacan-metadata-label {
text-align: var(--metadata-label-alignment, left);
}
.tainacan-metadata-value {
text-align: var(--metadata-value-alignment, left);
font-family: var(--fontFamily);
font-size: var(--fontSize);
font-weight: var(--fontWeight);

View File

@ -405,6 +405,10 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
--fontSize: 14px;
}
.tainacan-item-single .tainacan-single-item-section {
text-align: var(--section-alignment, left);
}
.tainacan-item-single .tainacan-item-section__document {
display: flex;
justify-content: center;
@ -578,14 +582,27 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
outline: none;
}
.tainacan-item-single .tainacan-item-section__gallery-items .tainacan-item-section__attachments-file .swiper-slide-name,
.tainacan-item-single .tainacan-item-section__attachments .tainacan-item-section__attachments-file .swiper-slide-name {
display: block;
margin-top: 0.5rem;
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__gallery-items .tainacan-item-section__attachments-file a,
.tainacan-item-single .tainacan-item-section__attachments .tainacan-item-section__attachments-file a {
width: 100%;
max-width: var(--attachments-size, 140px);
font-size: 0.875rem;
text-align: center;
word-break: break-all;
line-height: 1.5rem;
}
.tainacan-item-single .tainacan-item-section__gallery-items .tainacan-item-section__attachments-file a,
@ -706,7 +723,12 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
word-wrap: break-word;
}
.tainacan-item-single .tainacan-item-section__metadata .tainacan-metadata-label {
text-align: var(--metadata-label-alignment, left);
}
.tainacan-item-single .tainacan-item-section__metadata .tainacan-metadata-value {
text-align: var(--metadata-value-alignment, left);
font-family: var(--fontFamily);
font-size: var(--fontSize);
font-weight: var(--fontWeight);

File diff suppressed because one or more lines are too long

2
style.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,6 @@
href="<?php echo $href; ?>">
<?php
echo wp_get_attachment_image( $attachment->ID, 'blocksy-tainacan-item-attachments', true );
echo '<br>';
?>
<span class="swiper-slide-name <?php if (get_theme_mod( $prefix . '_hide_files_name', 'no') == 'yes') echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>
</a>
@ -48,7 +47,6 @@
href="<?php echo $img_scr[0] ?>">
<?php
echo wp_get_attachment_image( $attachment->ID, 'blocksy-tainacan-item-attachments', true );
echo '<br>';
?>
<span class="swiper-slide-name <?php if (get_theme_mod( $prefix . '_hide_files_name', 'no') == 'yes') echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>
</a>
@ -108,7 +106,6 @@
<li class="tainacan-item-section__attachments-file swiper-slide">
<?php
the_post_thumbnail('tainacan-medium');
echo '<br>';
?>
<span class="swiper-slide-name <?php if (get_theme_mod( $prefix . '_hide_files_name', 'no') == 'yes') echo 'sr-only' ?>"><?php echo __( 'Document', 'blocksy-tainacan' ); ?></span>
</li>