Skip to content

Instantly share code, notes, and snippets.

$white: #fff;
$spacing-unit: 1em;
.footer-nav {
color: $white;
&__title {
margin-bottom: $spacing-unit;
color: $white;
}
@segovia94
segovia94 / photoswipe_markup.html
Last active August 25, 2015 19:55
Photoswipe slide creation by scraping markup
<ul class="gallery">
<li>
<a href="/images/slide-1.jpg" data-size="1920x1080">
<img src="/images/thumb-1.jpg" alt="img1">
</a>
</li>
<li>
<a href="/images/slide-2.jpg" data-size="1920x1080">
<img src="/images/thumb-2.jpg" alt="img2">
</a>
@segovia94
segovia94 / responsive-sprite.scss
Last active March 21, 2016 19:43
Responsive Sprite
// Responsive sprite (horizontal)
@mixin responsive-sprite($sprite-url, $images: (), $width: 100%, $padding-bottom: 100%) {
display: block;
padding-bottom: $padding-bottom;
height: 0;
width: $width;
background-image: url($sprite-url);
background-repeat: no-repeat;
background-size: 100% * length($images);
background-position: 0 0;
@segovia94
segovia94 / ckeditor-faq-list.css
Created September 18, 2015 19:39
FAQ List for the CKEditor style dropdown
/* List FAQ */
.list-faq {
margin-top: 1em;
padding: 0;
list-style: none;
}
.list-faq > li {
padding: .5em .5em .5em 30px;
}
.list-faq > li:nth-child(odd):not(:first-child) {
@segovia94
segovia94 / _header-images.blade.php
Last active September 28, 2015 18:38
Custom Laravel Helper
<?php // resources/views/partials/_header-images.blade.php ?>
<div class="header-images">
@foreach($images as $image)
<div>{!! Html::image($image) !!}</div>
@endforeach
</div>
@segovia94
segovia94 / quick-summary.html
Created January 15, 2016 19:43
quick summary
<div class="quick-summary align-right">
<h2 class="quick-summary__title">This is a Title</h2>
<ul class="quick-summary__list">
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</div>
<div class="panel-pane box--large">
<form action="#" class="search-directory">
<input type="text" name="search" placeholder="search" class="search-directory__input">
<input type="submit" value="pages" class="search-directory__submit">
<input type="submit" value="people" class="search-directory__submit">
<input type="submit" value="departments" class="search-directory__submit">
</form>
</div>
<div class="panel-pane bg-transparent align-center">
<ul class="list--pipe">
@segovia94
segovia94 / prepare-commit-msg
Last active March 22, 2016 19:56
Git hook to prepend an issue number to commit messages based on the current branch name
#!/bin/sh
# Add this file to a git repo's ./git/hooks directory
# Automatically adds branch issue ID to the beginning of every commit message.
# Branches mush end in "-(int)" like Issue-Name-1234
# Adapted from http://waiting-for-dev.github.io/blog/2014/07/19/append-issue-number-to-commit-message-automatically-with-git-hooks/
# Change the branch issue name for each project
REPONAME='SITEFARM'
@segovia94
segovia94 / facebook-ckeditor-embed.html
Created April 12, 2016 23:56
Facebook Embed into Ckeditor
<div data-oembed-url="https://www.facebook.com/UCDavis/videos/vb.13917075214/10156814277770215">
<div class="responsive-iframe">
<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FUCDavis%2Fvideos%2Fvb.13917075214%2F10156814277770215&width=500&show_text=false&height=281&appId" width="500" height="281" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</div>
</div>
@segovia94
segovia94 / banner_image.php
Last active August 27, 2021 06:06
Drupal 8 preprocess custom image render from node
<?php
$node = \Drupal::routeMatch()->getParameter('node');
// Add a Banner to pages when a Featured Image is used
if ($node && !$node->field_featured_image->isEmpty()) {
$image = $node->field_featured_image->entity;
// Create the Render Array
$variables['banner_image'] = [