Skip to content

Instantly share code, notes, and snippets.

View scottgruber's full-sized avatar

Scott Gruber scottgruber

View GitHub Profile
@scottgruber
scottgruber / UCLA Color Palette c. 2004
Last active August 29, 2015 13:56
Sass variables for the UCLA Color Palette c. 2004
/* Sass Variables for UCLA Color Palette c. Sept 2004 */
// Identity Colors
$uclablue : rgb(83,104,149); // #536895
$uclagold : rgb(255,187,54); // #ffb300
// Secondary palette
// Full Intensity Colors
@scottgruber
scottgruber / UCLA Color Palette c. 2013 -
Last active August 29, 2015 13:56
Sass variables for UCLA Color Palette c. 2013 -
/* New UCLA Color Palette ver. 1 release 03/23/2012 */
// Primary color
$uclablue : rgb(50, 132, 191); // #3399cc
// Secondary Colors
$uclagold : rgb(254,187,54); // #ffb300
$uclayellow : rgb(255,232,0); // #ffe800
@scottgruber
scottgruber / UC-Color-Palette
Last active August 29, 2015 13:59
UC Color Palette. Sass variables for University of California brand colors.
// University of California Color Palette
// http://brand.universityofcalifornia.edu/guidelines/color.html
// Primary Colors
$ucblue : rgb(18,149,216); //#1295D8
$ucgold : rgb(255,181,17); //#ffb511
$blue-uc : rgb(0,85,129); //#005581
$liteblue-uc : rgb(114,205,244); //#72CDF4
$gold-uc : rgb(255,210,0); //#ffd200
$litegold-uc : rgb(255,229,82); //#ffe552;
@scottgruber
scottgruber / Flexslider template for Perch
Last active August 29, 2015 14:02
Flexslider template for Perch
<perch:before>
<!-- open slider-container -->
<div class="slider-container">
<!-- open flexslider -->
<div class="flexslider">
<ul class="slides">
</perch:before>
<li><a href="<perch:content id="link" type="text" label="Hyperlink" help="This is the link where you want user to go to." required="true" order="4" />"><img class="img-rounded" rel="caption1" src="<perch:content id="image" type="image" label="Slide image" width="640" height="360" crop="true" order="2" required="true" help="Image will be cropped to 640 x 360" bucket="images" />" alt="<perch:content id="alt" type="text" label="Image description" order="3" />" /></a><div class="flex-caption" style="bottom: 0;"><h1><a href="<perch:content id="link" type="text" label="Hyperlink" help="This link can go to a page on our site or an external site." />"><perch:content id="heading" title="true" type="smarttext" label="Heading" help="This is the title. Max length is 100 characters and then heading on slider will append ..." required="true" order="1" chars="100
@scottgruber
scottgruber / code.html
Last active November 10, 2015 17:43
Perch template for Prism syntax highlighter
<pre>
<code class="<perch:content id="code_snippet" type="select" options="Markup|language-markup,CSS|language-css,JavaScript|language-javascript,SCSS|language-scss,PHP|language-php,Markdown|language-markdown,Git|language-git,Python|language-python,React JSX|language-jsx" label="Kind of code snippet" help="Select from the options what kind of code snippet this is so we can target an approate css selector." allowempty="true" />">
<perch:content id="textarea" type="textarea" label="Code" html="false" markdown="false" size="l" />
</code>
</pre>
@scottgruber
scottgruber / block_template.html
Last active July 27, 2023 14:32
Using perch:related in a block proof of concept.
<perch:block type="related_article_block" label="Related Articles">
<perch:template path="content/blocks/related_article_block.html" />
</perch:block>
@scottgruber
scottgruber / Page titles using layouts
Last active January 31, 2016 17:55
How to get page titles in Perch runway collection, blog or basic page
In my global header layout file I use
<?php
if (perch_layout_has('blog-post')) {
perch_blog_post_meta(perch_get('s'));
} elseif (perch_layout_has('collection-post')) {
echo '<title>' . perch_layout_var('title', true) . '</title>';
}
else{
echo '<title>' . perch_pages_title(true) . '</title>';
// UCLA Color Palette 2016
// Primary Colors
$uclablue : rgb(50, 132, 191); // #3284bf
$uclagold : rgb(254,187,54); // #ffe800
$uclabluetext : rgb(52,123,173); // #347bad
// Secondary Colors
$ucladarkblue : rgb(30,75,135); // #1e4b87
$uclaliteblue : rgb(0,165,229); // #00a5e5
@scottgruber
scottgruber / if-not-exists-sample
Created September 19, 2016 23:07
Using perch:if not-exists="perch_item_last" to add comma or closing period in a list
<perch:repeater id="authors" label="Author(s)" order="2">
<perch:content id="firstname" type="smarttext" chars="1" label="First Name/Initial" required="true" /><perch:if exists="firstname">. </perch:if><perch:content id="middlename" type="smarttext" chars="1" label="Middle Name/Initial"/><perch:if exists="middlename">. </perch:if> <perch:content id="lastname" type="smarttext" label="Last Name" required="true"/><perch:if not-exists="perch_item_last">, <perch:else />. </perch:if>
</perch:repeater>