Skip to content

Commit

Permalink
Update CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
robincornett committed May 14, 2019
1 parent e1784a0 commit 79f3b1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion includes/css/display-featured-image-genesis.css

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

20 changes: 12 additions & 8 deletions includes/output/class-displayfeaturedimagegenesis-enqueue.php
Expand Up @@ -44,8 +44,10 @@ public function __construct( $setting, $item, $version ) {
* @since 3.1.0
*/
public function enqueue_style() {
$css_file = apply_filters( 'display_featured_image_genesis_css_file', plugin_dir_url( __FILE__ ) . 'css/display-featured-image-genesis.css' );
wp_enqueue_style( 'displayfeaturedimage-style', esc_url( $css_file ), array(), $this->version );
$css_file = apply_filters( 'display_featured_image_genesis_css_file', plugin_dir_url( dirname( __FILE__ ) ) . 'css/display-featured-image-genesis.css' );
if ( $css_file ) {
wp_enqueue_style( 'displayfeaturedimage-style', esc_url( $css_file ), array(), $this->version );
}
$this->add_inline_style();
}

Expand All @@ -55,10 +57,10 @@ public function enqueue_style() {
*/
public function enqueue_scripts() {
$minify = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_register_script( 'backstretch', plugins_url( "/includes/js/backstretch{$minify}.js", dirname( __FILE__ ) ), array( 'jquery' ), '2.1.16', true );
wp_register_script( 'backstretch', plugins_url( "/js/backstretch{$minify}.js", dirname( __FILE__ ) ), array( 'jquery' ), '2.1.16', true );
wp_enqueue_script(
'displayfeaturedimage-backstretch-set',
plugins_url( "/includes/js/backstretch-set{$minify}.js", dirname( __FILE__ ) ),
plugins_url( "/js/backstretch-set{$minify}.js", dirname( __FILE__ ) ),
array(
'jquery',
'backstretch',
Expand Down Expand Up @@ -172,10 +174,12 @@ private function get_max_height_css() {
* @return string
*/
private function get_image_css() {
$css = $this->get_object_position();
$height = $this->setting['less_header'];
if ( $height ) {
$css .= "height: calc( 100vh - {$height}px );";
$css = $this->get_object_position();
if ( $this->setting['less_header'] ) {
$css .= "height: calc( 100vh - {$this->setting['less_header']}px );";
}
if ( $this->setting['fade'] ) {
$css .= "animation: fadein {$this->setting['fade']}ms;";
}
if ( $css ) {
$css = ".big-leader--scriptless img { {$css} }";
Expand Down
5 changes: 5 additions & 0 deletions sass/display-featured-image-genesis.scss
Expand Up @@ -64,6 +64,11 @@
}
}

@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}

.backstretch.no-js {
max-height: 600px;
}
Expand Down

0 comments on commit 79f3b1e

Please sign in to comment.