Skip to content

Instantly share code, notes, and snippets.

View interplaydesign's full-sized avatar

interplaydesign

View GitHub Profile
@interplaydesign
interplaydesign / .zshrc
Created May 21, 2020 18:01
Git merge bash script to merge current branch with master
gmergebranch(){
currentbranch=`git rev-parse --abbrev-ref HEAD`
echo $currentbranch
if [ $currentbranch = "master" ]; then
echo -e "\033[1;31mYou are on the master branch. This is for merging branches to master\e[0m"
else
echo -e "\033[0;36mYou are on the $currentbranch branch \e[0m"
echo -e "\033[0;36mCommitting everything with message\e[0m \033[0;32m$1 \e[0m"
git commit -a -m "$1"
echo -e "\033[0;36mCommit complete. Moving to master \e[0m"
@interplaydesign
interplaydesign / navigation.js
Last active May 27, 2020 15:07
part of navigation.js
var slideUp = function slideUp(target) {
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
target.style.transitionProperty = 'height, margin, padding';
target.style.transitionDuration = duration + 'ms';
target.style.boxSizing = 'border-box';
target.style.height = target.offsetHeight + 'px';
target.offsetHeight;
target.style.overflow = 'hidden';
target.style.height = 0;
target.style.paddingTop = 0;
@interplaydesign
interplaydesign / _mixins.scss
Last active January 5, 2021 21:36
AWD2 Mixins
// Rem output with px fallback
@mixin font-size($sizeValue: 1) {
font-size: ($sizeValue * 16) * 1px;
font-size: $sizeValue * 1rem;
}
//Eg: @include theme-font-size(content, small);
@mixin theme-font-size($use: content, $size: body) {
@if $use==heading {
@if $size==small {
@interplaydesign
interplaydesign / functions.php theme_setup
Last active January 12, 2021 14:46
AWD2 theme_setup function for add_theme_supports
if ( ! function_exists( 'awd2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function awd2_setup() {
/*
@interplaydesign
interplaydesign / _structure.scss
Created January 5, 2021 21:39
themefolder/sass/variables/_structure.scss
$size__site-main: 100%;
$size__site-sidebar: 25%;
/**
* Horizontal spaces
*/
$gutter: 30px;
$gutter--half: 15px;
/* Includes 50px column plus 15px half gutter on each side */
$column: 80px;
@interplaydesign
interplaydesign / functions.php full
Created January 12, 2021 14:47
AWD2 Lesson 3 functions.php
<?php
/**
* awd2 functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package awd2
*/
if ( ! defined( '_S_VERSION' ) ) {
@interplaydesign
interplaydesign / style-editor.scss
Last active January 19, 2021 20:52
AWD2 Lesson 3 - starting the style-editor styles
/* Imports variables, mixins */
@import "sass/abstracts/abstracts";
@import "sass/base/typography/typography";
//Only applies to editor content part of editor screen
body{
font-family: $font__main;
}
//Use the variable you created in sass/abstracts/variables/_typography.scss
h1,h2,h3,h4,h5,h6{
@interplaydesign
interplaydesign / _typography.scss
Created January 12, 2021 16:46
AWD2 typography variables. Location: sass/abstracts/variables/_typography.scss
// stylelint-disable value-keyword-case
$font__main: 'Open Sans', sans-serif;
$font__heading: 'PT Serif', serif;
// stylelint-enable value-keyword-case
$font__code: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
$font__pre: "Courier 10 Pitch", courier, monospace;
$font__line-height-body: 1.5;
$font__line-height-pre: 1.6;
@interplaydesign
interplaydesign / _blocks.scss
Last active January 12, 2021 18:00
AWD2 components/content/_blocks.scss
/**
* Color classes
* identical slugs and color values as in
* add_theme_support('editor-color-palette'... in functions.php
*/
$colors: (
"white": #fff,
"blue": #052f46,
"light-red": #f7bba4,
"tan": #f8f0dc,
@interplaydesign
interplaydesign / _posts_and_pages.scss
Last active January 19, 2021 20:57
AWD2 posts and pages styles sass/components/content/_posts_and_pages.scss
.sticky {
display: block;
}
.post,
.page {
margin: 0 0 1.5em;
}
.updated:not(.published) {