3 * Preview for the Bartik theme.
5 (function($, Drupal, drupalSettings) {
8 callback(context, settings, $form) {
9 // Change the logo to be the real one.
10 if (!this.logoChanged) {
11 $('.color-preview .color-preview-logo img').attr(
13 drupalSettings.color.logo,
15 this.logoChanged = true;
17 // Remove the logo if the setting is toggled off.
18 if (drupalSettings.color.logo === null) {
19 $('div').remove('.color-preview-logo');
22 const $colorPreview = $form.find('.color-preview');
23 const $colorPalette = $form.find('.js-color-palette');
28 $colorPalette.find('input[name="palette[bg]"]').val(),
33 .find('.color-preview-main h2, .color-preview .preview-content')
34 .css('color', $colorPalette.find('input[name="palette[text]"]').val());
36 .find('.color-preview-content a')
37 .css('color', $colorPalette.find('input[name="palette[link]"]').val());
40 const $colorPreviewBlock = $colorPreview.find(
41 '.color-preview-sidebar .color-preview-block',
43 $colorPreviewBlock.css(
45 $colorPalette.find('input[name="palette[sidebar]"]').val(),
47 $colorPreviewBlock.css(
49 $colorPalette.find('input[name="palette[sidebarborders]"]').val(),
52 // Footer wrapper background.
54 .find('.color-preview-footer-wrapper')
57 $colorPalette.find('input[name="palette[footer]"]').val(),
61 const gradientStart = $colorPalette
62 .find('input[name="palette[top]"]')
64 const gradientEnd = $colorPalette
65 .find('input[name="palette[bottom]"]')
69 .find('.color-preview-header')
72 `background-color: ${gradientStart}; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(${gradientStart}), to(${gradientEnd})); background-image: -moz-linear-gradient(-90deg, ${gradientStart}, ${gradientEnd});`,
76 .find('.color-preview-site-name')
79 $colorPalette.find('input[name="palette[titleslogan]"]').val(),
83 })(jQuery, Drupal, drupalSettings);