Skip to content

Instantly share code, notes, and snippets.

View kieranphilipbrown's full-sized avatar
🏠
Working from home

Kieran Brown kieranphilipbrown

🏠
Working from home
View GitHub Profile
@kieranphilipbrown
kieranphilipbrown / asp.net if statement for element attribute
Last active February 25, 2020 15:17
Basic razor conditional statement for outputting different attributes within element.
@{
<a
class="cta primary-ghost--white"
if (CurrentRoot(Model.Content.Site()) == "ca") {
@Html.Raw("href='/find-an-event'")
} else if (CurrentRoot(Model.Content.Site()) == "uk") {
@Html.Raw("href='events'")
} else {
@Html.Raw("href='ca/find-an-event'")
}
@kieranphilipbrown
kieranphilipbrown / animation.css
Created April 28, 2019 16:43
CSS Animation Prefixes #css
/* animation keyframe prefixes */
#box {
-webkit-animation: NAME-YOUR-ANIMATION 5s infinite; /* Safari 4+ */
-moz-animation: NAME-YOUR-ANIMATION 5s infinite; /* Fx 5+ */
-o-animation: NAME-YOUR-ANIMATION 5s infinite; /* Opera 12+ */
animation: NAME-YOUR-ANIMATION 5s infinite; /* IE 10+, Fx 29+ */
}
@kieranphilipbrown
kieranphilipbrown / custom-breakpoint-mixin.scss
Last active March 21, 2019 18:45
Custom Sass Breakpoint Mixin
@mixin breakpoint($breakpoint-value) {
@media (min-width: #{$breakpoint-value + 'px'}) {
@content;
}
}
.header {
background: orange;
@include breakpoint(400) {
@kieranphilipbrown
kieranphilipbrown / IE 10 & 11 absolute positioned images with overlay
Last active January 29, 2019 15:35
IE 10 & 11 absolute positioned images with overlay& flexbox #ie11 #ie10 #ie #position #absolute #flexbox
Basically, if an image is positioned absolute, with the parent given a relative position argument a value for top, right, bottom, right should be given. I.e. 0 for each with centre the element.
.d_pullout_banner {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;