<div class="site-search site-search--mobile-only">
    <form action="/search" method="post" class="site-search__form--visible">
        <input name="searchTerm" type="text" id="searchTerm" class="site-search__query" placeholder="Search site">
        <button type="submit" role="button" class="site-search__submit">
	    	<img class="search-icon" src="/assets/icons/search_grey.svg" onerror="this.src='/assets/icons/search_gret.png';this.onerror=null;">
	    </button>
    </form>
</div>

<div class="site-search site-search--mobile-only">
    <form action="/search" method="post" class="site-search__form--visible">
	    <input name="searchTerm" type="text" id="searchTerm" class="site-search__query" placeholder="Search site">
	    <button type="submit" role="button" class="site-search__submit">
	    	<img class="search-icon" src="/assets/icons/search_grey.svg" onerror="this.src='/assets/icons/search_gret.png';this.onerror=null;">
	    </button>
	</form>
</div>
/* No context defined for this component. */
.site-search__query {
    transition: width 0.4s ease-in-out;
    display: inline-block;
    vertical-align: middle;
    @include mq($from: med) {
    	width: 130px;
    	width: calc(100% - 33px);
	}
}
.site-search__form {
	display: none;
}
.site-search__form--visible {
	@include mq ($from: med) {
		position: absolute;
		top: 100%;
		top: calc(100% + 1em);
		#{$right}:0;
		width:400px;		
		padding: 0.5em;
		background: $white;
		z-index: z("search-form");
		display: block;
		background-color: rgba($grey--light, 0.9);
	}
}
.site-search__trigger {
	padding: 0 2px;
}
.site-search__trigger--active {
	background-color: rgba($grey--light, 0.9);
	&:after {
		content: '';
		height: 17px;
		display: inline-block;
		background-color: rgba($grey--light, 0.9);
		position: absolute;
		z-index: 3;
		bottom:-17px;
		left: 4px;
		right: 0;
	}
}
.site-search__submit {
	display: inline-block;
	vertical-align: middle;
	#{$margin-left}: -5px;
}
.site-search--mobile-only {
	display: block;
	background: $grey--light;
	padding: 1em;
	margin: 1em -1em 0 -1em;
	.site-search__query {
		width: calc(100% - 33px);
		border-width: 2px;
		border-style: solid;
		border-width: 2px 0 2px 2px;
		border-color: $grey;
	}
	.site-search__submit {
		border-width: 2px;
		border-style: solid;
		border-width: 2px 2px 2px 0;
		border-color: $grey;
	}
	.search-icon {
		width: 30px;
		height: 30px;
	}
	@include mq ($from: med) {
		display: none;
	}
}
.site-search--desktop-only {
	display: none;
	@include mq ($from: med) {
		text-align: flip(right,left);
		display: block;
		float: flip(right,left);
		width: 40px;
		margin-top: 9px;
    	height: 32px;
		position: relative;
		.site-search__query {
			width: 70%;
			width: calc(100% - 74px);
			padding: 0 0.5em;
			border: 2px solid $grey;
		}
	}
}
.search-icon {
	display: block;
	width: 32px;
	height: 32px;
}
$(document).ready(function() {
	var $searchFormTrigger = $('.js-search-form-trigger'),
		$searchForm = $searchFormTrigger.next('.site-search__form');
	$(document).on('click',$searchFormTrigger, function(e) {
		if(!$(e.target).parents('.site-search').has(e.target).length) {
			$searchFormTrigger.removeClass('site-search__trigger--active');
    		$searchFormTrigger.parent().removeClass('site-search--active');
    		$searchForm.removeClass('site-search__form--visible');
		} else {
			$searchFormTrigger.addClass('site-search__trigger--active');
    		$searchFormTrigger.parent().addClass('site-search--active');
    		$searchForm.addClass('site-search__form--visible');
		}
	});
});

There are no notes for this item.