Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Logo: change enqueued CSS file depending on lang. & setti… #13654

Merged
merged 4 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion modules/theme-tools/site-logo/css/site-logo-control-rtl.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
/**
* RTL styles for the Site Logo control. Just swaps the button sides.
* Styles for the Site Logo control.
*/
#customize-control-site_logo .current {
margin-bottom: 6px;
}

#customize-control-site_logo .current span {
border: 1px solid #eee;
border-radius: 2px;
color: #555;
display: block;
overflow: hidden;
line-height: 40px;
min-height: 40px;
padding: 0 6px;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}

#customize-control-site_logo .current img {
max-width: 100%;
}

#customize-control-site_logo button.new,
#customize-control-site_logo button.change,
#customize-control-site_logo button.remove {
height: auto;
width: 48%;
white-space: normal;
}

#customize-control-site_logo .remove {
float: right;
margin-left: 3px;
Expand All @@ -10,3 +41,9 @@
#customize-control-site_logo .change {
float: left;
}

#customize-control-site_logo .customize-control-description {
display: block;
clear: both;
margin-bottom: 10px;
}

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

3 changes: 2 additions & 1 deletion modules/theme-tools/site-logo/css/site-logo-control.min.css

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

23 changes: 21 additions & 2 deletions modules/theme-tools/site-logo/inc/class-site-logo-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,27 @@ public function enqueue() {
// Enqueues all needed media resources.
wp_enqueue_media();

// Enqueue our control script and styles.
wp_enqueue_style( 'site-logo-control', plugins_url( '../css/site-logo-control.css', __FILE__ ) );
/*
* Enqueue our control script and styles.
*/

// We only enqueue a minified version of the file on prod. Jetpack.
$min = (
( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
|| ( defined( 'IS_WPCOM' ) && IS_WPCOM )
)
? ''
: '.min';

wp_enqueue_style(
'site-logo-control',
plugins_url( '../css/site-logo-control.css', __FILE__ ),
array(),
JETPACK__VERSION
);
wp_style_add_data( 'site-logo-control', 'rtl', 'replace' );
wp_style_add_data( 'site-logo-control', 'suffix', $min );

wp_enqueue_script( 'site-logo-control', plugins_url( '../js/site-logo-control.js', __FILE__ ), array( 'media-views', 'customize-controls', 'underscore' ), '', true );
}

Expand Down
1 change: 1 addition & 0 deletions tools/builder/admin-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const admincss = [
'modules/post-by-email/post-by-email.css',
'modules/protect/protect-dashboard-widget.css',
'modules/sharedaddy/admin-sharing.css',
'modules/theme-tools/site-logo/css/site-logo-control.css',
'modules/videopress/videopress-admin.css',
'modules/videopress/css/editor.css',
'modules/videopress/css/videopress-editor-style.css',
Expand Down