Skip to content

Commit

Permalink
update icons
Browse files Browse the repository at this point in the history
billerickson committed Jan 23, 2019
1 parent 64a048b commit 830744b
Showing 41 changed files with 66 additions and 40 deletions.
5 changes: 0 additions & 5 deletions assets/icons/angle-down.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/icons/angle-left.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/icons/angle-right.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/icons/angle-up.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/icons/close.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/icons/menu.svg

This file was deleted.

3 changes: 0 additions & 3 deletions assets/icons/search.svg

This file was deleted.

1 change: 1 addition & 0 deletions assets/icons/social/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/social/feed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/social/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/social/linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/social/pinterest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/social/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/social/youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/angle-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/angle-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/angle-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/angle-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/comment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/course.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/cuisine.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/heart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/list.svg
1 change: 1 addition & 0 deletions assets/icons/utility/lock.svg
1 change: 1 addition & 0 deletions assets/icons/utility/menu.svg
1 change: 1 addition & 0 deletions assets/icons/utility/minus.svg
1 change: 1 addition & 0 deletions assets/icons/utility/play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/print.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/servings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/star-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/utility/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions inc/helper-functions.php
Original file line number Diff line number Diff line change
@@ -144,8 +144,32 @@ function ea_bg_image_style( $image_id = false, $image_size = 'full' ) {
* Get Icon
*
*/
function ea_icon( $slug = '' ) {
$icon_path = get_template_directory() . '/assets/icons/' . $slug . '.svg';
if( file_exists( $icon_path ) )
return file_get_contents( $icon_path );
function ea_icon( $atts = array() ) {

$atts = shortcode_atts( array(
'icon' => false,
'group' => 'utility',
'size' => 16,
'class' => false,
), $atts );

if( empty( $atts['icon'] ) )
return;

$icon_path = get_template_directory() . '/assets/icons/' . $atts['group'] . '/' . $atts['icon'] . '.svg';
if( ! file_exists( $icon_path ) )
return;

$icon = file_get_contents( $icon_path );

$class = 'svg-icon';
if( !empty( $atts['class'] ) )
$class .= ' ' . esc_attr( $atts['class'] );

$repl = sprintf( '<svg class="' . $class . '" width="%d" height="%d" aria-hidden="true" role="img" focusable="false" ', $atts['size'], $atts['size'] );
$svg = preg_replace( '/^<svg /', $repl, trim( $icon ) ); // Add extra attributes to SVG code.
$svg = preg_replace( "/([\n\t]+)/", ' ', $svg ); // Remove newlines & tabs.
$svg = preg_replace( '/>\s*</', '><', $svg ); // Remove white space between SVG tags.

return $svg;
}
4 changes: 2 additions & 2 deletions inc/navigation.php
Original file line number Diff line number Diff line change
@@ -71,8 +71,8 @@ function ea_archive_paginated_navigation() {
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query->max_num_pages,
'prev_text' => ea_icon( 'angle-left' ),
'next_text' => ea_icon( 'angle-right' ),
'prev_text' => ea_icon( array( 'icon' => 'angle-left' ) ),
'next_text' => ea_icon( array( 'icon' => 'angle-right' ) ),
) );

if( $navigation ) {
2 changes: 1 addition & 1 deletion searchform.php
Original file line number Diff line number Diff line change
@@ -14,5 +14,5 @@
<span class="screen-reader-text">Search for</span>
<input type="search" class="search-field" placeholder="Search&hellip;" value="<?php echo get_search_query(); ?>" name="s" title="Search for" />
</label>
<button type="submit" class="search-submit"><?php echo ea_icon( 'search' );?><span class="screen-reader-text">Submit</span></button>
<button type="submit" class="search-submit"><?php echo ea_icon( array( 'icon' => 'search', 'size' => 16 ) );?><span class="screen-reader-text">Submit</span></button>
</form>

0 comments on commit 830744b

Please sign in to comment.