Skip to content

Commit

Permalink
Split Jetpack styles into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonoronha committed Mar 7, 2019
1 parent 404dffc commit 7ae1233
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
9 changes: 6 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = function( grunt ) {
'assets/css/woocommerce/extensions/*.css',
'assets/css/woocommerce/woocommerce.css',
'assets/css/woocommerce/woocommerce-legacy.css',
'assets/css/jetpack/jetpack.css',
'assets/css/jetpack/infinite-scroll.css',
'assets/css/jetpack/widgets.css',
'assets/css/base/*.css'
]
}
Expand Down Expand Up @@ -165,7 +166,8 @@ module.exports = function( grunt ) {
'assets/css/woocommerce/extensions/quick-view.css': 'assets/css/woocommerce/extensions/quick-view.scss',
'assets/css/woocommerce/woocommerce.css': 'assets/css/woocommerce/woocommerce.scss',
'assets/css/woocommerce/woocommerce-legacy.css': 'assets/css/woocommerce/woocommerce-legacy.scss',
'assets/css/jetpack/jetpack.css': 'assets/css/jetpack/jetpack.scss',
'assets/css/jetpack/infinite-scroll.css': 'assets/css/jetpack/infinite-scroll.scss',
'assets/css/jetpack/widgets.css': 'assets/css/jetpack/widgets.scss',
'assets/css/base/icons.css': 'assets/css/base/icons.scss',
'assets/css/base/gutenberg-blocks.css': 'assets/css/base/gutenberg-blocks.scss',
'assets/css/base/gutenberg-editor.css': 'assets/css/base/gutenberg-editor.scss'
Expand Down Expand Up @@ -450,7 +452,8 @@ module.exports = function( grunt ) {
'assets/css/woocommerce/woocommerce-legacy.css',
'assets/css/admin/welcome-screen/welcome.css',
'assets/css/admin/customizer/customizer.css',
'assets/css/jetpack/jetpack.css',
'assets/css/jetpack/infinite-scroll.css',
'assets/css/jetpack/widgets.css',
'assets/css/base/icons.css',
'assets/css/base/gutenberg-blocks.css',
'assets/css/base/gutenberg-editor.css'
Expand Down
18 changes: 18 additions & 0 deletions assets/css/jetpack/infinite-scroll.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Jetpack Infinite Scroll
*/

/* Globally hidden elements when Infinite Scroll is supported and in use. */
.paging-navigation, /* Older / Newer Posts Navigation (always hidden) */
.pagination,
.woocommerce-pagination,
ul.products + .storefront-sorting,
.woocommerce-result-count,
.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */
display: none;
}

/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before */
.infinity-end.neverending .site-footer {
display: block;
}
54 changes: 0 additions & 54 deletions assets/css/jetpack/jetpack.scss

This file was deleted.

30 changes: 30 additions & 0 deletions assets/css/jetpack/widgets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Jetpack Widgets
*/

// Imports
@import 'bourbon';
@import '../sass/utils/variables';
@import '../sass/utils/mixins';
@import '../sass/vendors/modular-scale';

// Subscription widget
.jetpack_subscription_widget {
#subscribe-email {
input {
padding: ms(-2) !important;
width: 100% !important;
}
}
}

// Google Translate widget
.widget_google_translate_widget {
img {
display: inline;
}

a {
text-decoration: none !important;
}
}
7 changes: 5 additions & 2 deletions inc/jetpack/class-storefront-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ public function jetpack_infinite_scroll_wrapper_columns() {
public function jetpack_scripts() {
global $storefront_version;

wp_enqueue_style( 'storefront-jetpack-style', get_template_directory_uri() . '/assets/css/jetpack/jetpack.css', '', $storefront_version );
wp_style_add_data( 'storefront-jetpack-style', 'rtl', 'replace' );
wp_enqueue_style( 'storefront-jetpack-infinite-scroll', get_template_directory_uri() . '/assets/css/jetpack/infinite-scroll.css', array( 'the-neverending-homepage' ), $storefront_version );
wp_style_add_data( 'storefront-jetpack-infinite-scroll', 'rtl', 'replace' );

wp_enqueue_style( 'storefront-jetpack-widgets', get_template_directory_uri() . '/assets/css/jetpack/widgets.css', array(), $storefront_version );
wp_style_add_data( 'storefront-jetpack-widgets', 'rtl', 'replace' );
}
}

Expand Down

0 comments on commit 7ae1233

Please sign in to comment.