Skip to content

Commit

Permalink
Adds option to toggle light color scheme. #548.
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuswetah committed Mar 17, 2022
1 parent 71f4eb7 commit a54a81f
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 24 deletions.
12 changes: 9 additions & 3 deletions src/assets/css/tainacan-gutenberg-block-item-gallery.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/classes/theme-helper/class-tainacan-theme-helper.php
Expand Up @@ -1126,7 +1126,8 @@ public function get_tainacan_related_items_carousel($args = []) {
* @type bool $hideFileDescriptionLightbox Hides the Lightbox file description
* @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item
* @type bool $showDownloadButtonMain Displays a download button bellow the Main slider
* @return string The HTML div to be used for rendering the item galery component
* @type bool $lightboxHasLightBackground Show a light background instead of dark in the lightbox
@return string The HTML div to be used for rendering the item galery component
*/
public function get_tainacan_item_gallery($args = []) {

Expand All @@ -1144,7 +1145,8 @@ public function get_tainacan_item_gallery($args = []) {
'hideFileCaptionLightbox' => false,
'hideFileDescriptionLightbox' => false,
'openLightboxOnClick' => true,
'showDownloadButtonMain' => true
'showDownloadButtonMain' => true,
'lightboxHasLightBackground' => false
);
$args = wp_parse_args($args, $defaults);

Expand All @@ -1169,6 +1171,7 @@ public function get_tainacan_item_gallery($args = []) {
$hide_file_description_lightbox = $args['hideFileDescriptionLightbox'];
$open_lightbox_on_click = $args['openLightboxOnClick'];
$show_download_button_main = $args['showDownloadButtonMain'];
$lightbox_has_light_background = $args['lightboxHasLightBackground'];

// Prefils arrays with proper values to avoid messsy IFs
$layout_elements = array(
Expand Down Expand Up @@ -1343,7 +1346,8 @@ public function get_tainacan_item_gallery($args = []) {
'disable_lightbox' => !$open_lightbox_on_click,
'hide_media_name' => $hide_file_name_lightbox,
'hide_media_caption' => $hide_file_caption_lightbox,
'hide_media_description' => $hide_file_description_lightbox
'hide_media_description' => $hide_file_description_lightbox,
'lightbox_has_light_background' => $lightbox_has_light_background
)
);
}
Expand Down
1 change: 1 addition & 0 deletions src/classes/theme-helper/template-tags.php
Expand Up @@ -1095,6 +1095,7 @@ function tainacan_has_related_items($item_id = false) {
* @type bool $hideFileDescriptionLightbox Hides the Lightbox file description
* @type bool $openLightboxOnClick Enables the behaviour of opening a lightbox with zoom when clicking on the media item
* @type bool $showDownloadButtonMain Displays a download button bellow the Main slider
* @type bool $lightboxHasLightBackground Show a light background instead of dark in the lightbox
* @return void
*/
function tainacan_the_item_gallery($args = []) {
Expand Down
4 changes: 4 additions & 0 deletions src/views/gutenberg-blocks/blocks/item-gallery/block.json
Expand Up @@ -112,6 +112,10 @@
"showDownloadButtonMain": {
"type": "boolean",
"default": false
},
"lightboxHasLightBackground": {
"type": "boolean",
"default": false
}
},
"supports": {
Expand Down

0 comments on commit a54a81f

Please sign in to comment.