This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const styleDiff = (elementOne, elementTwo) => { | |
const elOneStyles = window.getComputedStyle(elementOne); | |
const elTwoStyles = window.getComputedStyle(elementTwo); | |
const styleDiff = new Set(); | |
for (const prop in elOneStyles) { | |
if (elOneStyles[prop] !== elTwoStyles[prop]) { | |
styleDiff.add(`${prop}: ${elOneStyles[prop]} | ${elTwoStyles[prop]}`); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts hex color strings to array of HSL values. | |
* Code based on JS version: https://css-tricks.com/converting-color-spaces-in-javascript/. | |
* Formula here: https://www.rapidtables.com/convert/color/rgb-to-hsl.html. | |
* | |
* @param string $hexString | |
* The 6-character hexadecimal color code, optionally with a leading hash | |
* |
This gist contains various utility functions.
- getDomPath()
- getVisibleChildNodes()
- preventFocusOnClick()
- slideUp(), slideDown(), slideToggle()
- trapFocus(), focusTrap = {}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getVisibleChildNodes(input) { | |
if (!input instanceof Node) { | |
return false; | |
} else { | |
const filteredNodes = | |
// Create array from child nodes | |
Array.from(input.childNodes) | |
// Remove comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# SSH COMMANDS | |
## | |
# SSH into AWS Server | |
ssh -i ~/KEY_LOCATION ubuntu@IP_OR_WEBSITE | |
# Copy files from server | |
# scp SOURCE DESTINATION | |
scp USER@SERVER:PATH ~/Desktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Merge attributes onto an image | |
* | |
* Note: Attributes must have at least one non-null value. | |
* If you don't have a value, enter an single-space string (' '). | |
*/ | |
{% for item in items %} | |
{{ item.content|merge({'#item_attributes': {'attribute-name': ['attribute', 'values', 'here']}}) }} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements template_preprocess(). | |
*/ | |
function theme_preprocess(&$variables) { | |
/* Set variables to icon library */ | |
$variables['icons'] = '/themes/custom/THEME/assets/icons'; | |
$variables['brand_ico'] = '/themes/custom/THEME/assets/icons/brands.svg'; | |
$variables['light_ico'] = '/themes/custom/THEME/assets/icons/light.svg'; | |
$variables['regular_ico'] = '/themes/custom/THEME/assets/icons/regular.svg'; | |
$variables['solid_ico'] = '/themes/custom/THEME/assets/icons/solid.svg'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use this file to set CSS variables & root properties */ | |
/* Import google font */ | |
@import url(''); | |
/* Set root variables */ | |
:root { | |
/* Body paragraph text (used for rem sizing) */ | |
font-size: 18px; |